-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from BinPro/develop
New version 0.4.1
- Loading branch information
Showing
49 changed files
with
91,688 additions
and
145 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
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
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
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
Empty file.
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,21 @@ | ||
"""Functions for checking required programs""" | ||
import os | ||
|
||
|
||
def which(program): | ||
"""Look for executable http://stackoverflow.com/questions/377017""" | ||
def is_exe(fpath): | ||
return os.path.isfile(fpath) and os.access(fpath, os.X_OK) | ||
|
||
fpath, fname = os.path.split(program) | ||
if fpath: | ||
if is_exe(program): | ||
return program | ||
else: | ||
for path in os.environ["PATH"].split(os.pathsep): | ||
path = path.strip('"') | ||
exe_file = os.path.join(path, program) | ||
if is_exe(exe_file): | ||
return exe_file | ||
|
||
return None |
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,21 @@ | ||
"""Functions related to directory traversing/removement/creation""" | ||
import os | ||
import errno | ||
import shutil | ||
|
||
|
||
def mkdir_p(path): | ||
try: | ||
os.makedirs(path) | ||
except OSError as exc: | ||
if exc.errno == errno.EEXIST and os.path.isdir(path): | ||
pass | ||
else: | ||
raise | ||
|
||
|
||
def rm_rf(path): | ||
if os.path.isdir(path): | ||
shutil.rmtree(path) | ||
elif os.path.exists(path): | ||
os.remove(path) |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
# The requirements to build the documentation | ||
Sphinx==1.3.1 | ||
mock==1.0.1 | ||
sphinxcontrib-programoutput==0.8 | ||
sphinx-rtd-theme>=0.1.6 |
Binary file added
BIN
+12.1 KB
doc/source/_static/scripts/dna_diff_dist_matrix/hclust_dendrogram.pdf
Binary file not shown.
Binary file not shown.
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
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 |
---|---|---|
|
@@ -47,4 +47,4 @@ Contents: | |
installation | ||
usage | ||
complete_example | ||
|
||
scripts/index |
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,45 @@ | ||
====================== | ||
dnadiff_dist_matrix.py | ||
====================== | ||
|
||
Usage | ||
===== | ||
The usage and help documentation of ``dnadiff_dist_matrix.py`` can be seen by | ||
running ``pyhton dnadiff_dist_matrix -h``: | ||
|
||
.. program-output:: cat ../../scripts/dnadiff_dist_matrix.py | sed 's/import argparse/import argparse, conf/' | python - --help | ||
:shell: | ||
|
||
Example | ||
======= | ||
An example of how to run ``dnadiff_dist_matrix`` on the test data:: | ||
cd CONCOCT/scripts | ||
python dnadiff_dist_matrix.py test_dnadiff_out tests/test_data/bins/sample*.fa | ||
|
||
This results in the following output files in the folder ``test_dnadiff_out/``: | ||
|
||
- ``dist_matrix.stv`` The distance matrix | ||
- ``fasta_names.tsv`` The names given to each bin (or fasta file) | ||
- :download:`hcust_dendrogram.pdf <../_static/scripts/dna_diff_dist_matrix/hclust_dendrogram.pdf>` | ||
Dendrogram of the clustering (click for example) | ||
- :download:`hcust_heatmap.pdf <../_static/scripts/dna_diff_dist_matrix/hclust_heatmap.pdf>` | ||
Heatmap of the clustering (click for example) | ||
|
||
Then there is also for each pairwise ``dnadiff`` alignment the following output | ||
files in a subfolder ``fastaname1_vs_fastaname2/``:: | ||
|
||
out.1coords | ||
out.1delta | ||
out.cmd | ||
out.delta | ||
out.mcoords | ||
out.mdelta | ||
out.qdiff | ||
out.rdiff | ||
out.report | ||
out.snps | ||
out.unqry | ||
out.unref | ||
|
||
See MUMmer's own manual for an explanation of each file with ``dnadiff --help``. |
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,37 @@ | ||
====================== | ||
extract_scg_bins.py | ||
====================== | ||
|
||
Usage | ||
===== | ||
The usage and help documentation of ``extract_scg_bins.py`` can be seen by | ||
running ``pyhton extract_scg_bins -h``: | ||
|
||
.. program-output:: cat ../../scripts/extract_scg_bins.py | sed 's/import argparse/import argparse, conf/' | python - --help | ||
:shell: | ||
|
||
Example | ||
======= | ||
An example of how to run ``extract_scg_bins`` on the test data:: | ||
cd CONCOCT/scripts/tests/test_data | ||
python extract_scg_bins.py \ | ||
--output_folder test_extract_scg_bins_out \ | ||
--scg_tsvs tests/test_data/scg_bins/sample0_gt300_scg.tsv \ | ||
tests/test_data/scg_bins/sample0_gt500_scg.tsv \ | ||
--fasta_files tests/test_data/scg_bins/sample0_gt300.fa \ | ||
tests/test_data/scg_bins/sample0_gt500.fa \ | ||
--names sample0_gt300 sample0_gt500 \ | ||
--max_missing_scg 2 --max_multicopy_scg 4 \ | ||
--groups gt300 gt500 | ||
|
||
This results in the following output files in the folder ``test_extraxt_scg_bins_out/``:: | ||
$ ls test_extract_scg_bins_out/ | ||
sample0_gt300_bin2.fa sample0_gt500_bin2.fa | ||
|
||
Only bin2 satisfies the given criteria for both binnings. If we want to get the | ||
best binning of the two, one can remove the ``--groups`` parameter (or give | ||
them the same group id). That would only output ``sample0_gt500_bin2.fa``, | ||
because the sum of bases in the approved bins of ``sample0_gt500`` is higher | ||
than that of ``sample0_gt300``. |
Oops, something went wrong.