autometa.common.external package
Submodules
autometa.common.external.bedtools module
autometa.common.external.bowtie module
# License: GNU Affero General Public License v3 or later # A copy of GNU AGPL v3 should have been included in this software package in LICENSE.txt. Script containing wrapper functions for bowtie2.
- autometa.common.external.bowtie.align(db: str, sam: str, fwd_reads: Optional[List[str]] = None, rev_reads: Optional[List[str]] = None, se_reads: Optional[List[str]] = None, cpus: int = 0, **kwargs) str
Align reads to bowtie2-index db (at least one *_reads argument is required).
- Parameters
db (str) – </path/to/prefix/bowtie2/database>. I.e. db.{#}.bt2
sam (str) – </path/to/out.sam>
fwd_reads (list, optional) – [</path/to/forward_reads.fastq>, …]
rev_reads (list, optional) – [</path/to/reverse_reads.fastq>, …]
se_reads (list, optional) – [</path/to/single_end_reads.fastq>, …]
cpus (int, optional) – Num. processors to use (the default is 0).
**kwargs (dict, optional) – Additional optional args to supply to bowtie2. Must be in format: key = flag value = flag-value
- Returns
</path/to/out.sam>
- Return type
str
- Raises
ChildProcessError – bowtie2 failed
- autometa.common.external.bowtie.build(assembly: str, out: str) str
Build bowtie2 index.
- Parameters
assembly (str) – </path/to/assembly.fasta>
out (str) – </path/to/output/database> Note: Indices written will resemble </path/to/output/database.{#}.bt2>
- Returns
</path/to/output/database>
- Return type
str
- Raises
ChildProcessError – bowtie2-build failed
- autometa.common.external.bowtie.main()
- autometa.common.external.bowtie.run(cmd: str) bool
Run cmd via subprocess.
- Parameters
cmd (str) – Executable input str
- Returns
True if no returncode from subprocess.call else False
- Return type
bool
autometa.common.external.diamond module
autometa.common.external.hmmscan module
autometa.common.external.hmmsearch module
autometa.common.external.prodigal module
autometa.common.external.samtools module
Script containing wrapper functions for samtools
- autometa.common.external.samtools.main()
- autometa.common.external.samtools.sort(sam, bam, cpus=2)
Views then sorts sam file by leftmost coordinates and outputs to bam.
- Parameters
sam (str) – </path/to/alignment.sam>
bam (str) – </path/to/output/alignment.bam>
cpus (int, optional) – Number of processors to be used. By default uses all the processors of the system
- Raises
TypeError – cpus must be an integer greater than zero
FileNotFoundError – Specified path is incorrect or the file is empty
ExternalToolError – Samtools did not run successfully, returns subprocess traceback and command run