def test_features_from_file(self):
     filename = path.get_full_path(__file__, 'data',
                                   'fumigatus.cluster1.gff')
     features = gff_parser.get_features_from_file(open(filename))
     assert len(features) == 11
     for feature in features:
         assert feature.type == 'CDS'
         assert isinstance(feature.location, CompoundLocation)
Beispiel #2
0
def run_glimmerhmm(record: Record) -> None:
    """ Run glimmerhmm on the record, parse the results and add all detected
        genes to the record
    """
    with TemporaryDirectory(change=True):
        # Write FASTA file and run GlimmerHMM
        fasta_file = write_search_fasta(record)
        results_text = run_external(fasta_file)

    handle = StringIO(results_text)
    features = get_features_from_file(record, handle)
    for feature in features:
        record.add_biopython_feature(feature)
def run_glimmerhmm(record: Record) -> None:
    """ Run glimmerhmm on the record, parse the results and add all detected
        genes to the record
    """
    with TemporaryDirectory(change=True):
        # glimmerHMM/gff_parser handles some record names poorly (e.g. leading - or only '.')
        orig_id = record.id
        record.id = "input"
        # Write FASTA file and run GlimmerHMM
        fasta_file = write_search_fasta(record)
        record.id = orig_id
        results_text = run_external(fasta_file)

    if not "CDS" in results_text:
        return

    handle = StringIO(results_text)
    features = get_features_from_file(handle)["input"]
    for feature in features:
        record.add_biopython_feature(feature)