I converted the all.map file generated from MAQ tool to SAM format using maq2sam-long in samtools. The output file I named as Out. Now when I try to convert Out file (which is in SAM format) to BAM format using the command
samtools view -S Out
I get an error message that header @ not found. When I edit the Out file by manually adding @ at the top, more errors appear. What should I do? Is there a fault in the SAM file generated by the converter maq2sam ? Is there any other way to convert SAM file to BAM file? I tried 'samtool import' and that also does not work.
Unconfigured Ad
Collapse
X
-
I was trying to convert my single read illumina file to SAM format using the export2sam.pl script. It does not work and gives the following error:
Use of uninitialized value $t[21] in string ne at export2sam.pl line 67, <$fh1> line 14063.
Here is a sample data from my file.
HWUSI-EAS174_0025:2:1:5:488#0/1:CGGAGAATACGCTCCCATTCCCCCNGNANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNTNTGATCTTAGATCGGA:aabbbbb_baaa_a]ab`_aBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
HWUSI-EAS174_0025:2:1:5:1542#0/1:TGGATGCCTAGGCAATCAGAGGCGNANANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNANGTGATAAGCAGCGAA:abbbabbbbbbbbbbbbbbbBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
How do I resolve it ? Is there any other way?
A.
Leave a comment:
-
-
It depends on regions. If a region is repetitive then you need to filter out possible duplications which can cause artificial hetero SNPs. "Repetitive" here means kmer uniqueness --- how many times a given kmer (30mer for example) can be found in a reference.
Leave a comment:
-
-
Hi lh3
Originally Posted by xguo
I got a list of candidate SNPs using BWA and samtools for RNASeq data, and am trying to weigh various filtering options. "samtools.pl varFilter" gives a list of filtering criterion with default setting. The maximum read depth is set at 100. Given that duplicate reads have been removed by "samtools rmdup", do I still need to limit the maximum read depth?
replied by lh3:
Yes, you need this unless you are doing target sequencing in which case the read depth is expected to vary a lot.
My question
If we are doing variant calling in exome capture analysis, do i need to limit the max read depth when using samtool varFilter tool?
Leave a comment:
-
-
Dear All,
Do you know if samtools can perform multiple commands (>2) together? Here assuming that I have ten BAM files (result001.bam, result002.bam,......result010.bam) and want to merge them first and then sort and index them, the last step I hope is to extract the data for chromosome 1 (chr1), how can I edit the samtools command? I did it like this:
samtools merge result.bam result001.bam result002.bam ............result010.bam |\
samtools sort - result | \
samtools index result.bam | \
samtools view result.bam chr1 > resultchr1.bam
Is it right?
Thank you very much!
Wu
Leave a comment:
-
-
Is there sam2maq (sam to maq map format)? I am testing simulated data and like to convert ssaha2 alignment to maq output so that I can analyze them in maq. I cerated all the simu data in maq.
Thank you.
Leave a comment:
-
-
There was a discussion on how the CS tag should be generated in sam files according to the specs. Is there a consensus on how it is to be done?
I have to write a script to append the CS tag info to the BWA alignment of SOLID reads. I am hoping to make it as painless as possible.
Leave a comment:
-
-
You may convert to sam and count the lines as a proxy for checking.Originally posted by win804 View PostThanks Li Heng. I just want to confirm that nothing is wrong with the sorted bam file.
Thanks a lot.
but yes as lh3 mentioned sorted files compress better due to the compression algorithm
Leave a comment:
-
-
maq2sam-long
maq2sam <in.map> [<readGroup>], I want know how to use the option parameter 'readGroup',can it add library info from map to sam?Originally posted by lh3 View Postmaq2sam-short is for the .map files generated by maq-0.6.x, while maq2sam-long for files generated by maq-0.7.x. Sorry for the confusion, and one of the aims of SAM is to avoid such confusions in future.
Leave a comment:
-
-
Originally posted by lh3 View Post@corthay
You can convert with "blast2sam.pl -s" to save the sequence in SAM. Currently, samtools cannot parse SAM without sequence, although the specification allows this.
Hi Li,
I parse .sam with sequence, but samtools view still gave such error msg. Could you please take a look of the post:
Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc
Thanks.
Leave a comment:
-
-
Yes, I wanted to delete the previous thread before, however, I have no idea of how to do it. Any idea?Originally posted by maubp View PostYou already asked this on a separate thread
http://seqanswers.com/forums/showthread.php?t=5684
Thanks.
Leave a comment:
-
-
Thanks Li Heng. I just want to confirm that nothing is wrong with the sorted bam file.
Thanks a lot.
Leave a comment:
-
-
You already asked this on a separate threadOriginally posted by win804 View PostHi All,
Is "sorted" BAM file smaller in size compare to unsorted BAM file?
If that's the case, why is that so?...
Leave a comment:
-
-
Hi All,
Is "sorted" BAM file smaller in size compare to unsorted BAM file?
If that's the case, why is that so?
I sort a lot of BAM files using the samtools, with this command:
samtools sort chr1-aligned.bam chr1-aligned.sorted
file size of chr1-aligned.bam ==> 353,618,735 bytes
but the file size of chr1-aligned.sorted.bam ==> 295,208,534 bytes
I have checked for all my unsorted and sorted bam files. All of the sorted bam files are smaller in size compare to the unsorted ones.
Thanks.
Leave a comment:
-
Latest Articles
Collapse
-
by SEQadmin2
Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.
The systematic characterization of the human proteome has...-
Channel: Articles
07-20-2026, 11:48 AM -
-
by SEQadmin2
Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
...-
Channel: Articles
07-09-2026, 11:10 AM -
-
by SEQadmin2
Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.
There is no single reason why many patients don’t respond to treatment as expected. Cancer is...-
Channel: Articles
07-08-2026, 05:17 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, Yesterday, 11:41 AM
|
0 responses
9 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 11:41 AM
|
||
|
Started by SEQadmin2, 07-20-2026, 11:10 AM
|
0 responses
23 views
0 reactions
|
Last Post
by SEQadmin2
07-20-2026, 11:10 AM
|
||
|
Started by SEQadmin2, 07-13-2026, 10:26 AM
|
0 responses
36 views
0 reactions
|
Last Post
by SEQadmin2
07-13-2026, 10:26 AM
|
||
|
Started by SEQadmin2, 07-09-2026, 10:04 AM
|
0 responses
45 views
0 reactions
|
Last Post
by SEQadmin2
07-09-2026, 10:04 AM
|
Leave a comment: