SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering bowtie2 output sam file by mismatch number ty23991 Bioinformatics 0 05-18-2015 10:46 AM
htseq-out reduced number of the reads in the output sam file capricy Bioinformatics 0 03-02-2015 03:12 PM
Obtain coordinates of insert (e.g. bed file) from aligned paired-end reads (sam file) jajclement Bioinformatics 0 08-20-2013 07:13 AM
BWASW more reads in the output SAM file than in the input file nanto Bioinformatics 2 09-18-2012 01:41 AM
question about random select certain number of reads from ChIP-seq bed file yaolij@gmail.com Bioinformatics 1 09-15-2012 03:13 PM

Reply
 
Thread Tools
Old 11-08-2019, 08:05 AM   #1
bobbyle0210
Junior Member
 
Location: Hong Kong

Join Date: Nov 2019
Posts: 1
Default Couting number of similar reads in sam file and output in bed file

Hi all,
Currently, after mapping, I got a sam file which contained approximately 30 million mapped reads. Then, by using bedtool bamtobed, I was able to obtain a bed file. However, there were so many many similar reads.
Therefore, in order to reduce the size of the final bed file, is there any way that I can mention each read only once as well as its number of presentation in the sam file.

For instance:

var_1 0 15 ATGCATGCATGCCGTA
var_1 0 15 ATGCATGCATGCCGTA
var_1 0 15 ATGCATGCATGCCGTA
var_2 5 20 ATGCATGCGGGCCCC

Will become:
var_1 0 15 ATGCATGCATGCCGTA 3
var_2 5 20 ATGCATGCGGGCCCC 1

Thank you in advance!

Last edited by bobbyle0210; 11-08-2019 at 08:14 PM. Reason: cross-post
bobbyle0210 is offline   Reply With Quote
Old 11-08-2019, 08:41 AM   #2
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,992
Default

Cross-posted and answered on biostars: https://www.biostars.org/p/407019/
GenoMax is offline   Reply With Quote
Reply

Tags
bedtools, rna-seq, samtools

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 06:30 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO