Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# read2tree

read2tree is a software tool that allows to obtain alignment matrices for tree inference. For this purpose it makes use of the OMA database and a set of reads. Its strength lies in the fact that it bipasses the several standard steps when obtaining such a matrix in regular analysis. These steps are read filtereing, assembly, gene prediction, gene annotation, all vs all comparison, orthology prediction, alignment and concatination.
read2tree is a software tool that allows to obtain alignment matrices for tree inference. For this purpose it makes use of the OMA database and a set of reads. Its strength lies in the fact that it bipasses the several standard steps when obtaining such a matrix in regular analysis. These steps are read filtereing, assembly, gene prediction, gene annotation, all vs all comparison, orthology prediction, alignment and concatenation.

read2tree works in linux with [![Python 3.10.8](https://img.shields.io/badge/python-3.10.8-blue.svg)](https://www.python.org/downloads/release/python-310/)

Expand Down Expand Up @@ -43,7 +43,7 @@ conda install -c bioconda dendropy pysam
```

Besides, you need softwares including [mafft](http://mafft.cbrc.jp/alignment/software/) (multiple sequence aligner), [iqtree](http://www.iqtree.org/) (phylogenomic inference), [minimap2](https://github.com/lh3/minimap2) (long and short read mappers), and [samtools](http://www.htslib.org/download/) which could be installed using conda.
For this version, the `--read_type` argument could be either `short`, `long-hifi` or `long-ont`. You could also use `--threads 40` to be used with minimap2.
For this version, the `--read_type` argument accepts any minimap2 options string that defines how reads are aligned to the reference. For example, it could be `-ax sr`, `-ax map-hifi` or `-ax map-ont`. You can also pass `--threads 40` to be used with minimap2.
```
conda install -c bioconda mafft iqtree minimap2 samtools
```
Expand Down
14 changes: 6 additions & 8 deletions read2tree/Mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ def _call_wrapper(self, ref_file_handle, reads, tmp_output_folder):
sam_file= output_folder+"/"+ref_file_handle.split('/')[-1].split('.')[0]+".sam"

#self._output_shell(minimap2_ex+" -ax sr "+ ref_file_handle+ " -t " + str(self.args.threads) + " "+reads+" | "+samtools_ex+" view -F 4 -bh -S -t" + str(self.args.threads)+ " > " + bam_file)
if 'short' in self.args.read_type:
minimap_argm =" -ax sr"
elif 'long-hifi' in self.args.read_type:
minimap_argm = " -ax map-hifi "
elif 'long-ont' in self.args.read_type:
minimap_argm = " -ax map-ont "
else:
self.logger.error(" read_type is not valid" +self.args.read_type+" please use one of these: short long-ont long-hifi ")

rt = (self.args.read_type or "").strip()
if not rt:
self.logger.error("read_type is not set, please use one of these: -ax short, -ax long-ont, -ax long-hifi")
minimap_argm = f" {rt} "

if isinstance(reads,list):
reads_str=" ".join(reads)
elif isinstance(reads,str):
Expand Down
6 changes: 3 additions & 3 deletions read2tree/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def parse_args(argv, exe_name, desc):
help='[Default is none] Reads to be mapped to reference. If paired '
'end add separated by space.')

arg_parser.add_argument('--read_type', default='short',
help='[Default is short] Type of reads to '
'use for mapping: short, long-hifi or long-ont corresponding to sr, map-hifi, or map-ont in minimap2.')
arg_parser.add_argument('--read_type', default='-ax sr',
help='[Default is -ax sr] Minimap2 command-line options for mapping reads to reference. '
'Examples: -ax sr , -ax map-hifi , -ax map-pb or -ax map-ont ')

arg_parser.add_argument('--threads', type=int, default=1,
help='[Default is 1] Number of threads for the mapping ')
Expand Down