Skip to content

Commit

Permalink
expanded test
Browse files Browse the repository at this point in the history
  • Loading branch information
snacktavish committed Nov 10, 2018
1 parent 7b86fba commit d11cf66
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions tests/test_trim2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DnaCharacterMatrix, \
DataSet, \
datamodel
from physcraper import wrappers, generate_ATT_from_files, AlignTreeTax, OtuJsonDict, IdDicts, ConfigObj
from physcraper import generate_ATT_from_files, AlignTreeTax, OtuJsonDict, IdDicts, ConfigObj
import os
import json

Expand All @@ -25,12 +25,8 @@
conf = ConfigObj(configfi, interactive=False)
ids = IdDicts(conf, workdir=workdir)

if os.path.exists(otu_jsonfi):
print("load json")
otu_json = json.load(open(otu_jsonfi))
else:
otu_json = OtuJsonDict(id_to_spn, ids)
json.dump(otu_json, open(otu_jsonfi,"w"))
otu_json = OtuJsonDict(id_to_spn, ids)
json.dump(otu_json, open(otu_jsonfi,"w"))


data_obj = generate_ATT_from_files(seqaln=seqaln,
Expand All @@ -41,11 +37,26 @@
otu_json=otu_jsonfi,
ingroup_mrca=None)


for tax, seq in data_obj.aln.items():
len_start = len(seq)
next
len_start = len(seq)


data_obj.trim()

for tax, seq in data_obj.aln.items():
len_end = len(seq)

assert len_start == len_end


for tax, seq in data_obj.aln.items():
len_start = len(seq)


data_obj.trim(taxon_missingness=0.5)

for tax, seq in data_obj.aln.items():
len_end = len(seq)

assert len_start != len_end
assert len_start > len_end

0 comments on commit d11cf66

Please sign in to comment.