Tricky task with DNA sequences.

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tricky task with DNA sequences.
# 8  
Old 09-01-2011
I think they are included in the output:

zsh-4.3.12[t]% cat infile 
zsh-4.3.12[t]% perl -nle'BEGIN {
quote>   @map{ A, C, G, T } = ( T, G, C, A )
quote>   }
quote>   print /^>/ ?
quote>     $_ :
quote>       join //, map $map{ $_ }, split //, scalar reverse
quote>   ' infile

Am I missing something?
This User Gave Thanks to radoulov For This Post:
# 9  
Old 09-01-2011
This is the output I am getting
[Virus@localhost Testing]$ perl -nle'BEGIN {
> @map{ A, C, G, T } = ( T, G, C, A )
> }
> print /^>/ ?
> $_ :
> join //, map $map{ $_ }, split //, scalar reverse
> ' infile


[Virus@localhost Testing]$
Now I am not sure, I am missing something?

---------- Post updated at 10:13 AM ---------- Previous update was at 10:12 AM ----------

Input file was not the correct one!
It is working like a charm!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert a DNA sequence into Amino Acid

I am trying to write a bash script that would be able to read DNA sequences (each line in the file is a sequence) from a file, where sequences are separated by an empty line. I am then to find the amino acid that these DNA sequences encode per codon (each group of three literals.) For example, if I... (3 Replies)
Discussion started by: faizlo
3 Replies

2. Shell Programming and Scripting

Shell script for changing the accession number of DNA sequences in a FASTA file

Hi, I am having a file of dna sequences in fasta format which look like this: >admin_1_45 atatagcaga >admin_1_46 atatagcagaatatatat with many such thousands of sequences in a single file. I want to the replace the accession Id "admin_1_45" similarly in following sequences to... (5 Replies)
Discussion started by: margarita
5 Replies

3. HP-UX

Tricky situation getting IP address

Hi, I have a multihomed system HP-UX with two NIC cards having IP address & I have two weblogic servers running one listening on "" and the other on "" Given a PID how is it possible to extract the IP Address that the weblogic server is using and... (1 Reply)
Discussion started by: mohtashims
1 Replies

4. Solaris

Tricky egrep

Hi folks! My first post here. I'm working on a script that retrieves a range of files from a list depending on a range of time. UPDATE: I've seen it could be difficult to read all this thing, so I'll make a summarize it.. How come I do this and take a result.. grep "..\:.." |... (4 Replies)
Discussion started by: kl0x
4 Replies

5. Shell Programming and Scripting

Extracting DNA sequences from GenBank files using Perl

Hi all, Using Perl, I need to extract DNA bases from a GenBank file for a given plant species. A sample GenBank file is here... Nucleotide This is saved on my computer as I also have a file that is saved on my computer as NC_001666.txt. This text file has a list of all... (5 Replies)
Discussion started by: akreibich07
5 Replies

6. Shell Programming and Scripting

Parse an XML task list to create each task.xml file

I have an task definition listing xml file that contains a list of tasks such as <TASKLIST <TASK definition="Completion date" id="Taskname1" Some other <CODE name="Code12" <Parameter pname="Dog" input="5.6" units="feet" etc /Parameter> <Parameter... (3 Replies)
Discussion started by: MissI
3 Replies

7. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

8. Shell Programming and Scripting

Tricky Sed

Hello. I am trying to convert occurrences of 'NULL' from a datafile. The 'NULL' occurences appears at this: |NULL| NULL|NULL| NULL|NULL| NULL|NULL| NULL| There should be 52 fields per line. I would like any occurrence of | NULL| or |NULL| to appear as '||' Currently I am using this sed... (2 Replies)
Discussion started by: bestbuyernc
2 Replies

9. Windows & DOS: Issues & Discussions

Tricky one...

Here's my problem: I have a laptop running Windows XP Pro with no internal CD or Floppy drives. I want to install Linux on it. I don't care about the Windows XP Pro installation, in fact I would like to install Linux over the entirety of the HD. However I cannot boot from any external CD drive... (1 Reply)
Discussion started by: saabir
1 Replies
Login or Register to Ask a Question