bcbio / bcbio-nextgen

Validated, scalable, community developed variant calling, RNA-seq and small RNA analysis
https://bcbio-nextgen.readthedocs.io
MIT License
991 stars 354 forks source link

ChIP-Seq pipeline: allow bypassing alignment #1481

Closed LMannarino closed 8 years ago

LMannarino commented 8 years ago

(cc @lbeltrame )

I need to re-run the pipeline without file realignment, since they were previously generated. Setting the parameter aligner to false does not allow to bypass realignment and raises this error:

      1 from bcbio.ngsalign.bowtie2 import filter_multimappers
      2 import bcbio.pipeline.datadict as dd
      3 
      4 def clean_chipseq_alignment(data):
      5     aligner = dd.get_aligner(data)
----> 6     assert aligner == "bowtie2", "ChIP-seq only supported for bowtie2."
      7     if aligner == "bowtie2":
      8         data["raw_bam"] = dd.get_work_bam(data)
      9         unique_bam = filter_multimappers(dd.get_work_bam(data), data)
     10         data["work_bam"] = unique_bam

AssertionError: ChIP-seq only supported for bowtie2.

The ChiP-seq pipeline should support skipping the alignment step as the other pipelines. I last update the pipeline Tuesday 19 July 2016.

lpantano commented 8 years ago

Hi

sorry about this.

I pushed a fix for that, and it should be able to run with BAM files as input. The only thing is that the bam file should be ready to be used for peak calling, that cleaning function is only compatible with bowtie2.

I will add a warning for that.

thanks

lbeltrame commented 8 years ago

For context, these BAM files were made by the pipeline, and we just wanted to change the MACS2 parameters. Hence why this option may come in handy.

lpantano commented 8 years ago

sure, it is a good idea. Just want to add the message for other situations where the bam file doesn’t come from previous bcbio.

thanks for the suggestion

On Jul 19, 2016, at 10:08 AM, Luca Beltrame notifications@github.com wrote:

For context, these BAM files were made by the pipeline, and we just wanted to change the MACS2 parameters. Hence why this option may come in handy.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/chapmanb/bcbio-nextgen/issues/1481#issuecomment-233644297, or mute the thread https://github.com/notifications/unsubscribe-auth/ABi_HA1aqgXBYr8FGdsUpyatSM6Lj57nks5qXNpigaJpZM4JPuEH.

LMannarino commented 8 years ago

Just updated, unfortunately it does not work. It raises this error:


     7     if aligner:
      8         assert aligner == "bowtie2", "ChIP-seq only supported for bowtie2."
      9         unique_bam = filter_multimappers(dd.get_work_bam(data), data)
     10         data["work_bam"] = unique_bam
     11     else:
---> 12         logger.info("When BAM file is given, bcbio skips multimappers removal.")
     13         logger.info("If BAM is not cleaned for peak calling, can result in downstream errors.")
     14     return [[data]]
     15 
     16 

NameError: global name 'logger' is not defined
lpantano commented 8 years ago

sorry, forgot to push that one commit.

hopefully now it works?

LMannarino commented 8 years ago

yes, thank you very much!