In [1]:
# directory where you want the spacer blasting to be done
## CHANGE THIS!
workDir = "/home/nyoungb2/t/CLdb_Methanosarcina/loci_plots/"
In [2]:
import os
from IPython.display import Image
In [3]:
if not os.path.isdir(workDir):
os.makedirs(workDir)
In [4]:
# checking that CLdb is in $PATH & ~/.CLdb config file is set up
!CLdb --config-params
In [5]:
!CLdb -- plotLoci -h
In [6]:
!CLdb -- plotLoci --list
In [15]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_dna_segs > dna_segs.txt
# checking output
!cd $workDir; \
echo; \
head -n 5 dna_segs.txt
In [17]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- order_by_tree \
-tree Methanosarcina.nwk \
< dna_segs.txt \
> dna_segs_ord.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 dna_segs_ord.txt
In [18]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- format_dna_segs_colors \
< dna_segs_ord.txt \
> dna_segs_ord_col.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 dna_segs_ord_col.txt
In [19]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_xlims > xlims.txt
# checking output
!cd $workDir; \
echo; \
head -n 5 xlims.txt
In [20]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- order_by_tree \
-tree Methanosarcina.nwk \
< xlims.txt \
> xlims_ord.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 xlims_ord.txt
In [21]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_comparison < dna_segs_ord_col.txt
In [24]:
!cd $workDir; \
CLdb -- plotLoci -- run \
-d dna_segs_ord_col.txt \
-x xlims_ord.txt \
-t Methanosarcina_edit.nwk \
-f png \
-o all_loci
In [25]:
pngFile = os.path.join(workDir, 'all_loci.png')
Image(filename=pngFile)
Out[25]:
In [93]:
subtype = 'I-B'
In [94]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_dna_segs \
-subtype $subtype \
> dna_segs.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 dna_segs.txt
In [95]:
# prune tree to just taxa in table
!cd $workDir; \
CLdb -- plotLoci -- prune_tree \
-dna dna_segs.txt \
< Methanosarcina.nwk \
> Methanosarcina_prn.nwk
In [96]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- order_by_tree \
-tree Methanosarcina_prn.nwk \
< dna_segs.txt \
> dna_segs_ord.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 dna_segs_ord.txt
In [97]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- format_dna_segs_colors \
< dna_segs_ord.txt \
> dna_segs_ord_col.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 dna_segs_ord_col.txt
In [98]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_xlims \
-subtype $subtype \
> xlims.txt
# checking output
!cd $workDir; \
echo; \
head -n 5 xlims.txt
In [99]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- order_by_tree \
-tree Methanosarcina_prn.nwk \
< xlims.txt \
> xlims_ord.txt
# checking output
!cd $workDir; \
echo; \
head -n 3 xlims_ord.txt
In [100]:
# making table
!cd $workDir; \
CLdb -- plotLoci -- make_comparison \
< dna_segs_ord_col.txt \
> comparisons.txt
# checking output
!cd $workDir; \
echo; \
head -n 4 comparisons.txt
In [101]:
!cd $workDir; \
CLdb -- plotLoci -- run \
-d dna_segs_ord_col.txt \
-x xlims_ord.txt \
-t Methanosarcina_prn_edit.nwk \
-c comparisons.txt \
-f png \
-o $subtype
In [102]:
pngFile = os.path.join(workDir, subtype + '.png')
Image(filename=pngFile)
Out[102]:
In [ ]: