-
Notifications
You must be signed in to change notification settings - Fork 6
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
850cd95
commit 7b86fba
Showing
2 changed files
with
52 additions
and
1 deletion.
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
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,51 @@ | ||
from dendropy import Tree, \ | ||
DnaCharacterMatrix, \ | ||
DataSet, \ | ||
datamodel | ||
from physcraper import wrappers, generate_ATT_from_files, AlignTreeTax, OtuJsonDict, IdDicts, ConfigObj | ||
import os | ||
import json | ||
|
||
|
||
|
||
seqaln= "tests/data/Senecioneae_ets_update/Senecioneae_ets2.fas" | ||
mattype="fasta" | ||
treefile= "tests/data/Senecioneae_ets_update/2taxon.tre" | ||
schema_trf = "newick" | ||
workdir="tests/output/test_trim2" | ||
configfi = "tests/data/localblast.config" | ||
id_to_spn = r"tests/data/Senecioneae_ets_update/nicespl.csv" | ||
otu_jsonfi = "{}/otu_dict.json".format(workdir) | ||
|
||
|
||
|
||
if not os.path.exists("{}".format(workdir)): | ||
os.makedirs("{}".format(workdir)) | ||
|
||
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")) | ||
|
||
|
||
data_obj = generate_ATT_from_files(seqaln=seqaln, | ||
mattype=mattype, | ||
workdir=workdir, | ||
treefile=treefile, | ||
schema_trf = schema_trf, | ||
otu_json=otu_jsonfi, | ||
ingroup_mrca=None) | ||
|
||
for tax, seq in data_obj.aln.items(): | ||
len_start = len(seq) | ||
next | ||
data_obj.trim() | ||
for tax, seq in data_obj.aln.items(): | ||
len_end = len(seq) | ||
|
||
assert len_start != len_end |