Thomas,

Thanks for the quick response! s1_sortcoords is the output file name.
Using the '>' operator to generate the bam file still produces the same error 
in featureCounts (Subread).
It only processes 116 of the 875 contigs then states:

A format error was detected in this BAM file.
The remaining part in the file is skipped.
Please check the file format using samtools.

Yes, some of the contigs will be longer than 10kb after assembly.

samtools view -H shows the following...

@HD VN:1.0 SO:unsorted
@SQ SN:scaffold1.1|size2831460 LN:2831653
@SQ SN:scaffold2.1|size1074634 LN:1074707
@SQ SN:scaffold3.1|size507115 LN:507115
@SQ SN:scaffold4.1|size163333 LN:163333
@SQ SN:scaffold5.1|size128470 LN:128470
@SQ SN:scaffold6.1|size88380 LN:88428
@SQ SN:scaffold7.1|size27317 LN:27317
@SQ SN:scaffold8.1|size8051 LN:8051
@SQ SN:scaffold9.1|size6261 LN:6261
@SQ SN:scaffold10.1|size6189 LN:6189
@SQ SN:scaffold11.1|size4357 LN:4357
@SQ SN:scaffold12.1|size3321 LN:3321
@SQ SN:scaffold13.1|size2164 LN:2164
@SQ SN:scaffold14.1|size1648 LN:1648
@SQ SN:scaffold15.1|size1229 LN:1229
@PG ID:bowtie2 PN:bowtie2 VN:2.1.0

If my file is already sorted, then why does the header show 'unsorted'?

No, featureCounts module in Subread doesn't require the index.

Any other ideas?

---
Thanks,
Camille Daniels, Ph.D.
Post Doctoral Fellow
Red Sea Research Center
Al-Haytham West (Building 2), Room 2227-WS02
Thuwal, Saudi Arabia 23599-6900

camille.dani...@kaust.edu.sa
Office: +966 02 808 2446
---

________________________________________
From: Thomas W. Blackwell [tbla...@umich.edu]
Sent: Sunday, October 26, 2014 10:23 PM
To: Camille A. Daniels
Cc: samtools-help@lists.sourceforge.net
Subject: Re: [Samtools-help] bam file error

Camille -

The samtools command line looks fine except for the final 's1_sortcoords'.
Not sure what's intended there. If this is meant to be the output file
name, then either a redirection operator '>' is needed just before it, or
it should be the value of '-o' and be moved earlier before the input '-'.

I'm not at all familiar with 'subread', but my first step in debugging
would be to run 'samtools view -H' and see whether the .bam header lines
are what you expect them to be. Are the individual reads longer than,
say, 10 kb after assembly ? Does 'subread' expect an additional .bai
file, created with 'samtools index' ? Might try adding that. Just
guessing.

- tom blackwell -

On Sun, 26 Oct 2014, Camille A. Daniels wrote:

> Hello,
>
> I have a bam file formatting issue.
>
> samtools-0.1.18 (Linux) shows the bam to contain 875 reads mapped.
>
>
> [cid:c32e9022-0c2c-4630-85ab-c9d4ce1f4bf9]
>
> I've run featureCounts, a software module of Subread 
> (http://subread.sourceforge.net/) to count the number of read mapped per CDS 
> to a reference genome.
>
> The program only processes 116 reads for this bam (rather than the expected 
> 875), and suggests truncation or missing data.
>
>
> [cid:5abca696-b95f-4911-a199-37a47ebf33db]
>
>
> Can someone help debug the formatting issue?
>
> Workflow to create the bam file is as follows:
> -De novo assembly of reads in CLC Workbench
> -Bowtie2 to map reads against reference genome
> -Pipe to samtools to generate bam and sort file by coordinate
> -Run in featureCounts
>
> ./bowtie2 -x bact_contigs -f -a -t --no-unal -p 36 s1_assembly.fasta | 
> ~/samtools-0.1.18/samtools view -Shu - | ~/samtools-0.1.18/samtools sort -m 
> 5000000000 - s1_sortcoord
>
> I've re-generated the bam files with and without piping to samtools, and 
> versions of both software, but still get the same error.
>
>
> Also, below is a file size comparison for the file and its index.
>
>
> [cid:32f4bea4-956a-4a56-9b26-26c8ef290ecc]
>
>
>
>
>
> ---
> Thanks,
> Camille Daniels, Ph.D.
> Post Doctoral Fellow
> Red Sea Research Center
> Al-Haytham West (Building 2), Room 2227-WS02
> Thuwal, Saudi Arabia 23599-6900
>
> camille.dani...@kaust.edu.sa
> Office: +966 02 808 2446
> ---
>
> ________________________________
>
> This message and its contents including attachments are intended solely for 
> the original recipient. If you are not the intended recipient or have 
> received this message in error, please notify me immediately and delete this 
> message from your computer system. Any unauthorized use or distribution is 
> prohibited. Please consider the environment before printing this email.
>
------------------------------------------------------------------------------
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to