-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc4eeb0
commit 37151cf
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
import locidex.classes.seq_intake | ||
from locidex.constants import BLAST_TABLE_COLS | ||
|
||
|
||
PACKAGE_ROOT = os.path.dirname(locidex.__file__) | ||
|
||
|
||
def seq_intake_class_init(input_file, file_type, perform_annotation): | ||
return locidex.classes.seq_intake.seq_intake(input_file=input_file, | ||
file_type=file_type,feat_key='CDS',translation_table=11, | ||
perform_annotation=perform_annotation,num_threads=1,skip_trans=False) | ||
|
||
def test_read_fasta_file(): | ||
seq_intake_object = seq_intake_class_init(input_file=os.path.join(PACKAGE_ROOT, 'example/search/NC_003198.1.fasta'), | ||
file_type='fasta', perform_annotation=True) | ||
assert seq_intake_object.file_type == 'fasta' | ||
assert seq_intake_object.feat_key == 'CDS' | ||
assert seq_intake_object.status == True | ||
assert seq_intake_object.translation_table == 11 | ||
assert seq_intake_object.valid_types == ['genbank', 'gff', 'gtf', 'fasta'] | ||
assert len(seq_intake_object.seq_data) == 4653 | ||
assert sum([contig['aa_len'] for contig in seq_intake_object.seq_data]) == 2996811 | ||
assert all([True if 'NC_003198.1' in contig['parent_id'] else False for contig in seq_intake_object.seq_data]) == True | ||
assert all([True if 'NC_003198.1' in contig['locus_name'] else False for contig in seq_intake_object.seq_data]) == True | ||
assert all([True if 'NC_003198.1' in contig['seq_id'] else False for contig in seq_intake_object.seq_data]) == True | ||
assert len(seq_intake_object.seq_data[0]['dna_seq']) == 2463 | ||
assert seq_intake_object.seq_data[0]['dna_len'] == 2463 | ||
assert seq_intake_object.seq_data[0]['dna_hash'] == 'd1681ad4c3c1b07a5d0afc5a893afb1b' | ||
assert seq_intake_object.seq_data[0]['start_codon'] == 'atg' | ||
assert seq_intake_object.seq_data[0]['stop_codon'] == 'taa' | ||
assert seq_intake_object.seq_data[0]['count_internal_stop'] == 0 | ||
assert all([ True if contig['dna_ambig_count'] == 0 else False for contig in seq_intake_object.seq_data]) == True | ||
|
||
|
||
|
||
|
||
|