473,378 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Parsing

How do I write a program in Perl to extract % of sequence identity, overlap, e-value, etc. of FASTA results.
The file is somewhat like this:

FastaSummary Table



SUBMISSION PARAMETERS
TitleSequenceDatabaseuniprot
Sequence length417Sequence typep
ProgramfastaVersion3.4t25 Sept 2, 2005
Expectation upper value10.0MatrixBL50
Sequence range1-Number of scores50
Number of alignments50Word size2
Open gap penalty-10Gap extension penalty-2
Histogramfalse


AlignmentDB:IDSourceLengthIdentity%Similar%Overlap E()
1 UNIPROT:CBPA2_RAT Carboxypeptidase A2 precursor 417
100.000 100.000 417 9.7e-176
2 UNIPROT:Q504N0_MOUSE Carboxypeptidase A2, pancr 417
93.765 98.082 417 2.1e-166
3 UNIPROT:CBPA2_HUMAN Carboxypeptidase A2 precurs 417
87.050 96.163 417 1.4e-154
4 UNIPROT:Q53XS1_HUMAN Carboxypeptidase A2 (Pancr 417
86.811 95.923 417 5.5e-154
Sep 27 '06 #1
4 1640
How do I write a program in Perl to extract % of sequence identity, overlap, e-value, etc. of FASTA results.
The file is somewhat like this:

FastaSummary Table



SUBMISSION PARAMETERS
TitleSequenceDatabaseuniprot
Sequence length417Sequence typep
ProgramfastaVersion3.4t25 Sept 2, 2005
Expectation upper value10.0MatrixBL50
Sequence range1-Number of scores50
Number of alignments50Word size2
Open gap penalty-10Gap extension penalty-2
Histogramfalse


AlignmentDB:IDSourceLengthIdentity%Similar%Overlap E()
1 UNIPROT:CBPA2_RAT Carboxypeptidase A2 precursor 417
100.000 100.000 417 9.7e-176
2 UNIPROT:Q504N0_MOUSE Carboxypeptidase A2, pancr 417
93.765 98.082 417 2.1e-166
3 UNIPROT:CBPA2_HUMAN Carboxypeptidase A2 precurs 417
87.050 96.163 417 1.4e-154
4 UNIPROT:Q53XS1_HUMAN Carboxypeptidase A2 (Pancr 417
86.811 95.923 417 5.5e-154


could you please eloborate on exactly what you want to extract..
Sep 28 '06 #2
could you please eloborate on exactly what you want to extract..

I want to extract this portion:
AlignmentDB:IDSourceLengthIdentity%Similar%Overlap E()
1 UNIPROT:CBPA2_RAT Carboxypeptidase A2 precursor 417
100.000 100.000 417 9.7e-176
2 UNIPROT:Q504N0_MOUSE Carboxypeptidase A2, pancr 417
93.765 98.082 417 2.1e-166
3 UNIPROT:CBPA2_HUMAN Carboxypeptidase A2 precurs 417
87.050 96.163 417 1.4e-154
4 UNIPROT:Q53XS1_HUMAN Carboxypeptidase A2 (Pancr 417
86.811 95.923 417 5.5e-154.....etc
Sep 28 '06 #3
I want to extract this portion:
AlignmentDB:IDSourceLengthIdentity%Similar%Overlap E()
1 UNIPROT:CBPA2_RAT Carboxypeptidase A2 precursor 417
100.000 100.000 417 9.7e-176
2 UNIPROT:Q504N0_MOUSE Carboxypeptidase A2, pancr 417
93.765 98.082 417 2.1e-166
3 UNIPROT:CBPA2_HUMAN Carboxypeptidase A2 precurs 417
87.050 96.163 417 1.4e-154
4 UNIPROT:Q53XS1_HUMAN Carboxypeptidase A2 (Pancr 417
86.811 95.923 417 5.5e-154.....etc

==========

Hi,

i have written following code.

just change the name of the input file from demo,txt to your data file and re run it.
Let me know t he results of the same

#!/usr/bin/perl;

open(fp1,"demo.txt");

my @array;

#@array will hold the extracted pattern

my $i=0;

while(<fp1>)

{

#print "$_";

if(m/^[0-9]{1,1}[\s]{1,1}[a-zA-Z]{1,}/)

{

#print $_."\n";

$array[$i]=$_;

}

if(m/^[0-9]{1,}[\.]{1,1}[0-9]{1,1}/)

{

#print $_."\n";

$array[$i]=$_;

}

if(m/AlignmentDB:/)

{

#print "$_\n";

$array[$i]=$_;

}

$i++;

}

close(fp1);

#Finally print the content of array on

foreach my $pattern (@array)

{

print "$pattern";

}
Sep 29 '06 #4
kool thanks...

How to write a calender program displaying 3 months on each row?
Oct 2 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
0
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We...
9
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics"...
5
by: randy | last post by:
Can some point me to a good example of parsing XML using C# 2.0? Thanks
3
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
7
by: Daniel Fetchinson | last post by:
Many times a more user friendly date format is convenient than the pure date and time. For example for a date that is yesterday I would like to see "yesterday" instead of the date itself. And for...
1
by: eyeore | last post by:
Hello everyone my String reverse code works but my professor wants me to use pop top push or Stack code and parsing code could you please teach me how to make this code work with pop top push or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.