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

HLA typing - mapping of RNAseq fastqs - avoiding RazerS ressource dependencies #13

Closed
PeterBailey opened this issue Jul 30, 2018 · 2 comments

Comments

@PeterBailey
Copy link

The following code below was modified in main.nf.

Simply removed the unzip process and replaced with modified yara mapper script.

The code was run as follows:

nextflow run ~/nf_scripts/hlaTypingMaster -profile docker --reads '*_R{1,2}.fastq.gz' --seqtype 'rna' --outdir $PWD/SCC_hlatyping --index data/indices/yara/hla _reference_rna

Received error:

Jul-30 14:01:33.586 [Task monitor] ERROR nextflow.processor.TaskProcessor - Error executing process > 'map_fastq_to_hla (5)'

Caused by:
  Process `map_fastq_to_hla (5)` terminated with an error exit status (1)

Command executed:

  yara_mapper -e 3 -t 16 /home/pbailey/nf_scripts/hlaTypingMaster/data/indices/yara/hla_reference_rna MET2_R1.fastq.gz MET2_R2.fastq.gz -o output.bam
  samtools view -h -F 4 -f 0x40 -b1 output.bam > mapped_1.bam
  samtools view -h -F 4 -f 0x80 -b1 output.bam > mapped_2.bam

Command exit status:
  1

Command output:
  (empty)

Command error:
  Open failed on file /home/pbailey/nf_scripts/hlaTypingMaster/data/indices/yara/hla_reference_rna.txt.size: "No such file or directory"
  yara_mapper: Error while opening reference file.

if( params.bam ) log.info "BAM file format detected. Initiate remapping to HLA alleles with yara mapper."

/*
 * Preparation - Unpack files if packed.
 * 
 * OptiType cannot handle *.gz archives as input files, 
 * So we have to unpack first, if this is the case. 
 */
if ( !params.bam  ) { // FASTQ files processing
    process map_fastq_to_hla {
        input:
        set val(pattern), file(reads) from input_data

        output:
        set val(pattern), "mapped_{1,2}.bam" into raw_reads

        script:
        if (params.singleEnd)
        """
        yara_mapper -e 3 -t ${params.max_cpus} -f bam ${workflow.projectDir}/${params.index} ${reads[0]}  > output_1.bam
        samtools view -h -F 4 -b1 output_1.bam > mapped_1.bam
        """
        else
        """
        yara_mapper -e 3 -t ${params.max_cpus} ${workflow.projectDir}/${params.index} ${reads[0]} ${reads[1]} -o output.bam
        samtools view -h -F 4 -f 0x40 -b1 output.bam > mapped_1.bam
        samtools view -h -F 4 -f 0x80 -b1 output.bam > mapped_2.bam
        """
    }
} else { // BAM files processing

    /*
     * Preparation - Remapping of reads against HLA reference and filtering these
     *
     * In case the user provides BAM files, a remapping step
     * is then done against the HLA reference sequence.
     */
    process remap_to_hla {
        
        input:
        set val(pattern), file(bams) from input_data

        output:
        set val(pattern), "mapped_{1,2}.bam" into raw_reads

        script:
        if (params.singleEnd)
        """
        samtools bam2fq $bams > output_1.fastq
        yara_mapper -e 3 -t ${params.max_cpus} -f bam ${workflow.projectDir}/${params.index} output_1.fastq > output_1.bam
        samtools view -h -F 4 -b1 output_1.bam > mapped_1.bam
        """
        else
        """
        samtools view -h -f 0x40 $bams > output_1.bam
        samtools view -h -f 0x80 $bams > output_2.bam
        samtools bam2fq output_1.bam > output_1.fastq
        samtools bam2fq output_2.bam > output_2.fastq
        yara_mapper -e 3 -t ${params.max_cpus} -f bam ${workflow.projectDir}/${params.index} output_1.fastq output_2.fastq > output.bam
        samtools view -h -F 4 -f 0x40 -b1 output.bam > mapped_1.bam
        samtools view -h -F 4 -f 0x80 -b1 output.bam > mapped_2.bam
        """

    }

}
@sven1103
Copy link
Member

thanks @PeterBailey for reporting this. We will implement a pre-mapping step with yara in the next minor release of the HLA typing pipleline!

@sven1103 sven1103 changed the title HLA typing - mapping of RNAseq fastqs - avoiding Razor resource dependencies HLA typing - mapping of RNAseq fastqs - avoiding RazerS resource dependencies Aug 3, 2018
@sven1103 sven1103 changed the title HLA typing - mapping of RNAseq fastqs - avoiding RazerS resource dependencies HLA typing - mapping of RNAseq fastqs - avoiding RazerS ressource dependencies Aug 3, 2018
@sven1103
Copy link
Member

sven1103 commented Aug 3, 2018

solved in #15

@sven1103 sven1103 closed this as completed Aug 3, 2018
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