Performing Randomizations In Unix
2
0
Entering edit mode
13.0 years ago
Diana ▴ 30

Hi All!

Im working in Unix environment and im getting some problems in using Patser. Can someone help me? Patser finds PWMs for a set of sequences. I have some sequences. I want to shuffle them and then run Patser and I have to do this process a 1000 times. How do I do this? Does Patser do shuffling? I have found a Perl code to shuffle the sequences but I dont know how to use it together with Patser since I'm not much of a programmer. Please help!!

Edit: By shuffling I mean I have DNA sequences in which im trying to find motifs. I want to randomize the sequences so the sequences become different from original ones but keeping intact the no. of A,G,C and T. Patser finds the motifs. So I have to shuffle the sequences then run Patser and I have to do this a 1000 times.

Many thanks

• 2.6k views
ADD COMMENT
0
Entering edit mode

I guess you want to find the significance? that is why you wanna shuffle your sequences. It would be better if you explain exactly what you want from your data....because what it appears to me is a simple application of Monte Carlo, but to give you the complete code, I need to know what you are seeking out of your data.

ADD REPLY
5
Entering edit mode
13.0 years ago

man shuf:

for ((i = 0 ; i < 10000 ; i++))
do
   shuf < onesequenceperline.txt | yourtool >> result.txt
done
ADD COMMENT
0
Entering edit mode

Lets say I have a Perl file called shuffle.pl that shuffles and the tool is run using two files called analysis1.pl and analysis2.pl. How can I write them in this loop? Thanks!!

ADD REPLY
0
Entering edit mode

depending on how the tools take input and output you might be able to get away with: shuffle.pl yourseq.txt | analysis1.pl | analysis2.pl. In the loop above, Pierre is pointing out that there is a UNIX command called shuf (not available on all systems by default), which can shuffle an input sequence, and then the output of that (a shuffled sequence) gets piped to your tool, and the results of that are appended to a file called result.txt.

ADD REPLY
0
Entering edit mode

Thank you!! that helped

ADD REPLY
0
Entering edit mode
13.0 years ago
Neilfws 49k

Another potential option (depending on what precisely you mean by shuffle): EMBOSS shuffleseq. EMBOSS is quite easy to compile from source or may be in your distribution repository.

ADD COMMENT

Login before adding your answer.

Traffic: 1543 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6