scripts/support/update_go_terms.py
def main(go_term_file, option ,checkout_dir):
    """
    This function will check out a family from the SVN repository, modify the
    desc file to add the GO terms and then check family back to the SVN repository

    go_term_file: The path to a go term file. This should be a tab delimited
    file where multiple terms followed by their description, are
    checkout_dir: A destination directory where to checkout all families

    return: void
    """

    checkout_cmd = "rfco.pl %s"
    checkin_cmd = "rfci.pl -onlydesc -m \'GO terms added\' %s"

    if not os.path.exists(checkout_dir):
        os.mkdir(checkout_dir)

    os.chdir(checkout_dir)

    # parse go term file
    go_term_dict = None
    if option == "--curation":
        go_term_dict = parse_go_term_file(go_term_file)

    elif option == "--validation":
        go_term_dict = parse_go_term_validation_file(go_term_file)

    for rfam_acc in go_term_dict.keys():
        fam_go_terms = go_term_dict[rfam_acc]

        # make upper case
        rfam_acc = rfam_acc.upper()

        # checkout family if go term dictionary is not empty
        if bool(fam_go_terms) is not False:
            subprocess.call(checkout_cmd % rfam_acc.upper(), shell=True)

            family_dir = os.path.join(checkout_dir, rfam_acc.upper())

            # add GO terms to DESC
            if option == "--curation":
                update_desc_go_terms(fam_go_terms, os.path.join(family_dir, 'DESC'))

            elif option == "--validation":
                modify_desc_go_terms(fam_go_terms, os.path.join(family_dir, 'DESC'))

            # checkin family to SVN
            subprocess.call(checkin_cmd % rfam_acc.upper(), shell=True)

    This function will check out a family from the SVN repository, modify the
    desc file to add the GO terms and then check family back to the SVN repository

    go_term_file: The path to a go term file. This should be a tab delimited
    file where multiple terms followed by their description, are
    checkout_dir: A destination directory where to checkout all families

    return: void
    
This function will check out a family from the SVN repository, modify the
desc file to add the GO terms and then check family back to the SVN repository

The path to a go term file. This should be a tab delimited
file where multiple terms followed by their description, are
checkout_dir: A destination directory where to checkout all families

void
This function will check out a family from the SVN repository modify the desc file to add the GO terms and then check family back to the SVN repository The path to a go term file . This should be a tab delimited file where multiple terms followed by their description are checkout_dir : A destination directory where to checkout all families void
def main(go_term_file, option ,checkout_dir):
    checkout_cmd = "rfco.pl %s"
    checkin_cmd = "rfci.pl -onlydesc -m \'GO terms added\' %s"
    if not os.path.exists(checkout_dir):
        os.mkdir(checkout_dir)
    os.chdir(checkout_dir)
    go_term_dict = None
    if option == "--curation":
        go_term_dict = parse_go_term_file(go_term_file)
    elif option == "--validation":
        go_term_dict = parse_go_term_validation_file(go_term_file)
    for rfam_acc in go_term_dict.keys():
        fam_go_terms = go_term_dict[rfam_acc]
        rfam_acc = rfam_acc.upper()
        if bool(fam_go_terms) is not False:
            subprocess.call(checkout_cmd % rfam_acc.upper(), shell=True)
            family_dir = os.path.join(checkout_dir, rfam_acc.upper())
            if option == "--curation":
                update_desc_go_terms(fam_go_terms, os.path.join(family_dir, 'DESC'))
            elif option == "--validation":
                modify_desc_go_terms(fam_go_terms, os.path.join(family_dir, 'DESC'))
            subprocess.call(checkin_cmd % rfam_acc.upper(), shell=True)
def main ( go_term_file , option , checkout_dir ) : checkout_cmd = "rfco.pl %s" checkin_cmd = "rfci.pl -onlydesc -m \'GO terms added\' %s" if not os . path . exists ( checkout_dir ) : os . mkdir ( checkout_dir ) os . chdir ( checkout_dir ) go_term_dict = None if option == "--curation" : go_term_dict = parse_go_term_file ( go_term_file ) elif option == "--validation" : go_term_dict = parse_go_term_validation_file ( go_term_file ) for rfam_acc in go_term_dict . keys ( ) : fam_go_terms = go_term_dict [ rfam_acc ] rfam_acc = rfam_acc . upper ( ) if bool ( fam_go_terms ) is not False : subprocess . call ( checkout_cmd % rfam_acc . upper ( ) , shell = True ) family_dir = os . path . join ( checkout_dir , rfam_acc . upper ( ) ) if option == "--curation" : update_desc_go_terms ( fam_go_terms , os . path . join ( family_dir , 'DESC' ) ) elif option == "--validation" : modify_desc_go_terms ( fam_go_terms , os . path . join ( family_dir , 'DESC' ) ) subprocess . call ( checkin_cmd % rfam_acc . upper ( ) , shell = True )
This function will check out a family from the SVN repository, modify the
desc file to add the GO terms and then check family back to the SVN repository
This function will check out a family from the SVN repository modify the desc file to add the GO terms and then check family back to the SVN repository
"""
    This function will check out a family from the SVN repository, modify the
    desc file to add the GO terms and then check family back to the SVN repository

    go_term_file: The path to a go term file. This should be a tab delimited
    file where multiple terms followed by their description, are
    checkout_dir: A destination directory where to checkout all families

    return: void
    """ # parse go term file # make upper case # checkout family if go term dictionary is not empty # add GO terms to DESC # checkin family to SVN
go_term_file
option
checkout_dir