Perl scripts for FASTA/Junk DNA

varsha raja rnavarsha at yahoo.com
Mon Oct 21 22:04:05 EST 2002


Dear Arabidopsis Group Users

S. K.Patel and Varsha Raja*

Some new Programmes for FASTA  conversions and to
remove junk sequences from a group of genes/gene
family.


1. Pick up one  raw protein sequence(without fasta
format) save in one file.txt and  use the following
script file   as  commandline line argument.  e.g.
perl script file name  of the  following  script is
"fastaformat.pl "    and  sequence file is
"RawSeq.txt"(not fasta format file) then    type
command at the prompt  as following

     $ fastaformat.pl RawSeq.txt

     the output will be in  fasta format

     use this fasta format in NCBI for  Blasting
sequence

   2.For checking validity of this fasta format, first
take one sample sequence from NCBI  change into fast
format with the help of the program already provided
by Ncbi  AND save blast result in  one file .  And
then use the following script to convert the same raw
sequence  to convert into fasta  fasta format. Use
this  fasta formatted sequencce to  get  the blast
result. Now  whatever  blast result u   got , save in
other file  and  Compare both  blast results file. The
result will be same

   Following script  converts raw  protein sequence
into Fasta format

********************************************************************

#!/usr/bin/perl

system clear;

  open(FFF,$ARGV[0])  || warn  " can not open ****
first file";

      while($Genome=<FFF>)

    {

    $Genome=uc($Genome);

    $Genome=~s/ //g;

    print $Genome,"\n";

    }

  close(FFF);



*****************************************************************************

second script  to  remove the junk characters in
nucleotide  sequence

e.g. your sequence  get some junk characters  by
copying from computer or by

mistake u inserted some characaters other than
"ATGC"(four basic letters),the

following script  removes all unnecessary
characters(means filters the

sequnece  and final output is having only  "ATGC"
(nucleotide) contents

How to test the script

Make one text file say testing.txt having contents
following which contains junk characters

Contents of the file name  testing.txt as following

tg^c*ttcgh#ittgcatgggttc'tt:igg!tt~8$gttcggsstt$$@^ucgte+2%%&tagc

********************************************************************

#!/usr/bin/perl

system clear;



  open(FFF,$ARGV[0])  || warn  " can not open ****
first file";

  while($patel=<FFF>)

  {

      for($i=0;$i<=10000;$i++)

      { $sub=substr($Genome,$i,1);

        if(($sub eq  A)||($sub eq  T)||($sub eq
G)||($sub eq  C))

        { print $sub; }

      }

  }


*********************************************************************

Run the perl script at  promt

$ perl  filename.pl  testing.pl

Note: the output contains  only  ATGC


Regards,

Sincerely,

VARSHA RAJA
(Toronto)




__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
---



More information about the Arab-gen mailing list