Skip to content

Commit

Permalink
Merge pull request #27 from broadinstitute/dp-spades
Browse files Browse the repository at this point in the history
spades: expose more parameters
  • Loading branch information
dpark01 authored Dec 1, 2022
2 parents 0b33f08 + 5ab4101 commit 0784b5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assemble/spades.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def assemble(self, reads_fwd, reads_bwd, contigs_out, reads_unpaired=None, conti
if contigs_untrusted: args += [ '--untrusted-contigs', contigs_untrusted ]
if kmer_size: args += [ '-k', kmer_size ]
if spades_opts: args += shlex.split(spades_opts)
args += [ '--rna', '-m' + str(mem_limit_gb), '-t', str(threads), '-o', spades_dir ]
args += [ '-m' + str(mem_limit_gb), '-t', str(threads), '-o', spades_dir ]

transcripts_fname = os.path.join(spades_dir, ('hard_filtered_' if filter_contigs else '') + 'transcripts.fasta')

Expand Down
8 changes: 5 additions & 3 deletions assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ def assemble_spades(
in_bam,
clip_db,
out_fasta,
spades_opts='',
spades_opts='--rna',
contigs_trusted=None, contigs_untrusted=None,
filter_contigs=False,
min_contig_len=0,
kmer_sizes=(55,65),
kmer_sizes=(55,65,35),
n_reads=10000000,
outReads=None,
always_succeed=False,
Expand Down Expand Up @@ -326,6 +326,8 @@ def parser_assemble_spades(parser=argparse.ArgumentParser()):
help='Optional input contigs of high medium quality, previously assembled from the same sample')
parser.add_argument('--nReads', dest='n_reads', type=int, default=10000000,
help='Before assembly, subsample the reads to at most this many')
parser.add_argument('--kmerSizes', dest='kmer_sizes', type=int, nargs='+', default=(55,65,35),
help='Ordered list of kmer sizes to attempt')
parser.add_argument('--outReads', default=None, help='Save the trimmomatic/prinseq/subsamp reads to a BAM file')
parser.add_argument('--filterContigs', dest='filter_contigs', default=False, action='store_true',
help='only output contigs SPAdes is sure of (drop lesser-quality contigs from output)')
Expand All @@ -334,7 +336,7 @@ def parser_assemble_spades(parser=argparse.ArgumentParser()):
'an error code')
parser.add_argument('--minContigLen', dest='min_contig_len', type=int, default=0,
help='only output contigs longer than this many bp')
parser.add_argument('--spadesOpts', dest='spades_opts', default='', help='(advanced) Extra flags to pass to the SPAdes assembler')
parser.add_argument('--spadesOpts', dest='spades_opts', default='--rna', help='(advanced) Extra flags to pass to the SPAdes assembler')
parser.add_argument('--memLimitGb', dest='mem_limit_gb', default=4, type=int, help='Max memory to use, in GB (default: %(default)s)')
util.cmd.common_args(parser, (('threads', None), ('loglevel', None), ('version', None), ('tmp_dir', None)))
util.cmd.attach_main(parser, assemble_spades, split_args=True)
Expand Down
9 changes: 5 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Sphinx==1.4.4
sphinx-argparse==0.1.15
sphinx_rtd_theme==0.1.9
matplotlib==2.2.4
Sphinx>=5.3.0
sphinx-jinja2-compat
sphinx-argparse>=0.1.15
sphinx_rtd_theme>=0.1.9
matplotlib>=2.2.4
#PyYAML==5.1
mock>=2.0.0

0 comments on commit 0784b5a

Please sign in to comment.