Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify run_bwa_on_sample #156

Closed
averagehat opened this issue Jul 30, 2015 · 3 comments
Closed

Simplify run_bwa_on_sample #156

averagehat opened this issue Jul 30, 2015 · 3 comments

Comments

@averagehat
Copy link
Contributor

Is this still necessary? I know we don't need to filter on platforms any more. Not sure if compiling reads is necessary?

@necrolyte2
Copy link
Member

I believe this handles the Paired and Unpaired reads though which is
necessary since if a 454 or ion torrent run is done without paired end you
will need to do 2 separate mappings and join the bams together after

On Thu, Jul 30, 2015 at 4:26 PM, Mike Panciera [email protected]
wrote:

Is this

preads = reads_by_plat( args.reads )
logger.debug( "Reads parsed by platform: {0}".format(preads) )
reads = []
for plat in args.platforms:
if plat in preads:
reads += preads[plat]
# Creates reads/F.fq, reads/R.fq, reads/NP.fq
readdir = join(tdir,'reads')
os.makedirs( readdir )
reads = compile_reads( reads, readdir )
if not reads:
raise Exception( "Somehow no reads were compiled" )
if os.path.isdir( args.reference ):
cwd = os.getcwd()
os.chdir( tdir )
ref = join( tdir, compile_refs( args.reference ) )
os.chdir( cwd )
else:
ref = args.reference
# Keeps track so we know to merge bams later if it is 3
merge = 0
if reads['F'] is not None:
merge += 1
pairedsai = bwa_mem( reads['F'], reads['R'], ref, join(tdir, 'paired.sai'), t=args.threads )
if isinstance(pairedsai,int):
raise BWAError("There was an error running bwa")
pairedbam = ngs_mapper.bam.sortbam( ngs_mapper.bam.samtobam( pairedsai, PIPE ), join(tdir, 'paired.bam') )
#bam.indexbam( pairedbam )
if reads['NP'] is not None:
merge += 2
nonpairedsai = bwa_mem( reads['NP'], ref=ref, output=join(tdir, 'nonpaired.sai'), t=args.threads )
if isinstance(nonpairedsai,int):
raise BWAError("There was an error running bwa")
nonpairedbam = ngs_mapper.bam.sortbam( ngs_mapper.bam.samtobam( nonpairedsai, PIPE ), join(tdir, 'nonpaired.bam') )

still necessary? I know we don't need to filter on platforms any more. Not
sure if compiling reads is necessary?


Reply to this email directly or view it on GitHub
#156.

@averagehat
Copy link
Contributor Author

I am working on simplifying the pipeline up to the basecaller + runsample.py. That should make things smaller and easier to maintain and change.

Probably I may also want to change tests like test_project_directories_have_expected_files and test_consensus_mutations so that they do not take so long to run.

I want to use some declarative framework like Make or luigi. The only branching has to do with paired/unpaired and quality encoding, which can be determined statically (i.e. before the pipeline actually runs), so it should work out well.

If all goes well it will be easy to add steps like BAM cleaning before the base-calling or plotting happens as long as those two parts are connected reasonably.

@averagehat
Copy link
Contributor Author

Closing in favor of #155, #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants