[galaxy-dev] samtools view region

2012-06-20 Thread J.W.F.van_der_Heijden

Hi all,

I was working on the integration of the samtools view to work with Galaxy.
The idea is to filter an indexed bam file on a chromosome with samtools view 
-bh in.bam.bai chr1.
After some research I noted that samtools will only execute this command when 
it can find the corresponding sorted bam file, so the in.bam.

The problem is that Galaxy renames all the files. So in.bam will be for 
instance dataset_1.dat. When I index the bam file I will get an indexed bam 
file named dataset_2.dat. Samtools can't detect then that dataset_1.dat is the 
sorted bam file and dataset_2.dat is the bai file.

Now I was wondering if it is possible to rename files in the 
~/galaxy-dist/database/files/000 with a command line. So that dataset_2.dat 
will be moved to dataset_1.dat.bai.

Does anyone know how to do that?

Kind Regards,
Jaap
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Re: [galaxy-dev] samtools view region

2012-06-20 Thread Peter Cock
On Wed, Jun 20, 2012 at 2:59 PM,  j.w.f.van_der_heij...@lumc.nl wrote:

 Hi all,

 I was working on the integration of the samtools view to work with Galaxy.
 The idea is to filter an indexed bam file on a chromosome with samtools
 view -bh in.bam.bai chr1.
 After some research I noted that samtools will only execute this command
 when it can find the corresponding sorted bam file, so the in.bam.

 The problem is that Galaxy renames all the files. So in.bam will be for
 instance dataset_1.dat. When I index the bam file I will get an indexed bam
 file named dataset_2.dat. Samtools can't detect then that dataset_1.dat is
 the sorted bam file and dataset_2.dat is the bai file.

 Now I was wondering if it is possible to rename files in the
 ~/galaxy-dist/database/files/000 with a command line. So that dataset_2.dat
 will be moved to dataset_1.dat.bai.

 Does anyone know how to do that?

 Kind Regards,
 Jaap

The simple answer is a wrapper script which makes symlinks for
the BAM file and its BAI file using the normal naming conventions.

Peter
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] samtools view region

2012-06-20 Thread J.W.F.van_der_Heijden
Hi Peter,
Thanks for you quick answer! But I am very new to Galaxy. Could you explain 
something about those symlinks?

Regards,
Jaap 

From: Peter Cock [p.j.a.c...@googlemail.com]
Sent: Wednesday, June 20, 2012 4:01 PM
To: Heijden, J.W.F. van der (HG)
Cc: galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] samtools view region

On Wed, Jun 20, 2012 at 2:59 PM,  j.w.f.van_der_heij...@lumc.nl wrote:

 Hi all,

 I was working on the integration of the samtools view to work with Galaxy.
 The idea is to filter an indexed bam file on a chromosome with samtools
 view -bh in.bam.bai chr1.
 After some research I noted that samtools will only execute this command
 when it can find the corresponding sorted bam file, so the in.bam.

 The problem is that Galaxy renames all the files. So in.bam will be for
 instance dataset_1.dat. When I index the bam file I will get an indexed bam
 file named dataset_2.dat. Samtools can't detect then that dataset_1.dat is
 the sorted bam file and dataset_2.dat is the bai file.

 Now I was wondering if it is possible to rename files in the
 ~/galaxy-dist/database/files/000 with a command line. So that dataset_2.dat
 will be moved to dataset_1.dat.bai.

 Does anyone know how to do that?

 Kind Regards,
 Jaap

The simple answer is a wrapper script which makes symlinks for
the BAM file and its BAI file using the normal naming conventions.

Peter

___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/