Hello Devon,
The following command is giving me an error. Also can I write --rg PU=sample_1
instead of --rg PU:sample_1
Command: bowtie2 -x --rg-id sample_1 --rg SM:sample_1 --rg LB:sample_1 --rg
PL:illumina_hi-seq --rg PU:sample_1 bowtie2_index_hg38 -1
mrg_sample_1_R1_val_1.fq.gz -2 mrg_sample_1_R2_val_2.fq.gz | samtools view -Shb
- | samtools sort - test_4
Error: Warning: --rg was specified without --rg-id also being specified. @RG 
line is
not printed unless --rg-id is specified. Warning: Output file 'sample_1' was 
specified without -S. This will not work in
future Bowtie 2 versions. Please use -S instead. Extra parameter(s) specified: 
“bowtie2_index_hg38” Note that if <mates> files are specified using -1/-2, a 
<singles> file cannot also be specified. Please run bowtie separately for mates 
and singles. Error: Encountered internal Bowtie 2 exception (#1) Command: 
/usr/local/bin/../Cellar/bowtie2/2.2.6/bin/bowtie2-align-s --wrapper
basic-0 -x --rg-id --rg SM:sample_1 --rg LB:sample_1 --rg PL:illumina_hi-seq
--rg PU:sample_1 -1 /tmp/5308.inpipe1 -2 /tmp/5308.inpipe2 sample_1
bowtie2_index_hg38 (ERR): bowtie2-align exited with value 1

On 20 November 2015 at 21:14, Devon Ryan < [email protected] > wrote:
You can add the read group directly in bowtie2:

bowtie2 -x bowtie2_index_hg38 --rg-id sample1 --rg SM:sample1 ... | samtools
view -Su - | samtools sort - output

Picard's BuildBamIndex tool might be able to take input from a pipe (I'm pretty
sure this doesn't work with samtools at the moment), in which case:

... | picard SortSam INPUT=/dev/stdin OUTPUT=/dev/stdout | tee output.bam |
picard BuildBamIndex INPUT=/dev/stdin OUTPUT=output.bam.bai

Or something along those regards. I really can't recommend doing this, though.
Getting the index in an additional step is going to be a minuscule time savings.

Devon

On 11/20/2015 08:21 PM, Yaseen Ladak wrote:
Hi All,
I need some help I want to pipe the output from samtools to picard readgrous
commands but I am failing:
bowtie2 -x bowtie2_index_hg38 -1 R1.fq.gz -2 R2.fq.gz | samtools view -Shb - |
samtools sort - output

What I want to achieve is the following is to also add the read groups the
output.bam file from above command and also index the output bam file with reads
groups. I am failing with the following command and I dont know how to also
index the output bam file that has the read group.
bowtie2 -x bowtie2_index_hg38 -1 mrg_sample_1_R1_val_1.fq -2
mrg_sample_1_R2_val_2.fq | samtools view -Shb - | samtools sort - - | picard
AddOrReplaceReadGroups I= output.bam O=rg_output.bam RGID=sample_1 RGLB=sample_1
RGPL=illumina_hi-seq RGPU=sample_1 RGSM=sample_1
Can someone please help me? Thanks, Yaseen

------------------------------------------------------------------------------




_______________________________________________
Samtools-help mailing list
[email protected]https://lists.sourceforge.net/lists/listinfo/samtools-help



------------------------------ ------------------------------ ------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick. net/gampad/clk?id=254741551& iu=/4140
______________________________ _________________
Samtools-help mailing list
Samtools-help@lists. sourceforge.net
https://lists.sourceforge.net/ lists/listinfo/samtools-help
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Samtools-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to