No BAM records

206 views
Skip to first unread message

Natalia Bayona Vásquez

unread,
Aug 7, 2018, 2:03:46 PM8/7/18
to Stacks
Hi everyone,

I was trying to run gstacks of the version 2 beta using the script attached. Every step that map reads against the reference and produce sam, bam and sorted bam outputs runs without errors. And the respective folders and files are created. But when gstacks starts running I get the error:

Error: No BAM records.

Error: (At the 0th record in file '/lustre1/njbayona/Seriola_rivoliana_3RAD_2018/reference/bam_sorted_output/Sriv_1Atx.bam'.)

Aborted.


That is the first sample according to the population map. But that file is within the respective folder (I verified the path). I downloaded it and I am attaching it, in case you may want to use it to track the error. 


Thank you (once again) for all the support!

8_mappingreads_reference_Sriv.sh
Sriv_1Atx.bam

Julian Catchen

unread,
Aug 7, 2018, 5:32:12 PM8/7/18
to stacks...@googlegroups.com, Natalia Bayona Vásquez
Hi Natalia,

I'm not sure I understand your message. As far as I can tell, your BAM
file is empty. This file is not produced by gstacks, so I assume the
error is occurring somewhere in your alignment/BAM conversion. At which
stage are you losing data in the SAM/BAM files?

Also, with a recent version of samtools, you can do this all in one step
(without intermediate files), like this:

bwa mem path/bwa_db ./samples/file.1.fa.gz ./samples/file.2.fa.gz | \
samtools view -h -b | \
samtools sort > ./aligned/file.bam

Best,

julian

Natalia Bayona Vásquez wrote on 8/7/18 2:03 PM:

Natalia Bayona

unread,
Aug 7, 2018, 5:59:54 PM8/7/18
to Julian Catchen, stacks...@googlegroups.com
Thanks Julian,

I thought the BAM file was correct. But I will try to run samtools as you suggested. Hopefully that solves the error.

Best,

Natalia
--

Natalia J Bayona-Vásquez, PhD 
Environmental Health Science | Postdoctoral Research Associate 
150 E Green St | Athens, GA 30602

e: njba...@uga.edu 
w: http://njbayona7.wixsite.com

University of Georgia

Natalia Bayona

unread,
Aug 8, 2018, 11:50:29 PM8/8/18
to Julian Catchen, stacks...@googlegroups.com
That fixed my BAM files issue.

Thanks!

Natalia Bayona

unread,
Aug 9, 2018, 11:59:07 AM8/9/18
to Julian Catchen, stacks...@googlegroups.com
Hi Julian,

I found that when some samples in the population map didn't get hits against the reference and then the bam files are empty, gstacks stops running and the gstacks.catalog.fa.gz will be empty. Then I had to check the sizes of the bam files to find out which samples were bad and deleting these from the population map. And then gstacks was able to run. However, it will be convenient if somehow gstacks just omit these samples.

Thanks!

Nicolas Rochette

unread,
Aug 9, 2018, 12:17:41 PM8/9/18
to Stacks

Hi Natalia,

Isn't it a problem that some of your samples don't have any data?

Best,

Nicolas

--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/CAHr9SxT%3D9b57s4fOOYuX3YatS_wjMi1O%2BQQrOWivxs62pyCDZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Natalia Bayona

unread,
Aug 9, 2018, 1:18:46 PM8/9/18
to stacks...@googlegroups.com
You were right Nico! I double checked and somehow those files were corrupted when I transferred them to the cluster (the gzip format was not being recognized). I uploaded those once again and it is running right now and it should work. Thanks

To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users+unsubscribe@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Stacks" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stacks-users/2v6NHODqoD0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stacks-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/92059b37-f80f-4bfb-1ac0-48db64b13984%40illinois.edu.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages