HELP FORMATING A FILE

--------------08C999389F3C3A7954978482
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

HI All, I have a file from a blast report output which looks like the
following:

gi|12383919|gb|BF981107.1|BF981107  602310351F1 NIH_MGC_88 H...   271
4e-72
gi|12168431|gb|BF825777.1|BF825777  MR2-HN0035-171100-001-a0...   242
3e-63

                                                Alignments

>gi|12383919|gb|BF981107.1|BF981107 602310351F1 NIH_MGC_88 Homo sapiens
cDNA clone IMAGE:4401421 5'.
          Length = 967

 Score =  271 bits (694), Expect = 4e-72
 Identities = 135/141 (95%), Positives = 138/141 (97%)
 Frame = +3

Query: 17  QAGPWRVSAPPSGPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDTLLHLFAARGL
76
           +AGPWRVSAPPSGPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDTLLHLFAARGL
Sbjct: 15  EAGPWRVSAPPSGPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDTLLHLFAARGL
194

Query: 77  RWAAYAAAEVLQVYRRLDIREHKGKTPLLVAAAANQPLIVEDLLNLGAEPNAADHQGRSV
136
           RWAAYAAAEVLQVYRRLDIREHKGKTPLLVAAAANQPLIVEDLLNLGAEPNAADHQGRSV
Sbjct: 195 RWAAYAAAEVLQVYRRLDIREHKGKTPLLVAAAANQPLIVEDLLNLGAEPNAADHQGRSV
374

Query: 137 LHVAATYGLPGVLAVFKSGIQ 157
           LHVAATYGLPGVL V+ +G Q
Sbjct: 375 LHVAATYGLPGVLLVWPAGRQ 437

 Score = 32.7 bits (73), Expect = 4.4
 Identities = 21/46 (45%), Positives = 25/46 (53%), Gaps = 11/46 (23%)
 Frame = +2

Query: 133 GRSVLHVAAT------YGLPGVLAVFK-----SGIQVDLEARDFEG 167
           GR V  + A+      Y  P V  +F      SG+QVDLEARDFEG
Sbjct: 452 GRLVAQILASRPGGQGYPYPAVCLLFLPGCAYSGVQVDLEARDFEG 589

>gi|12168431|gb|BF825777.1|BF825777 MR2-HN0035-171100-001-a09 HN0035
Homo sapiens cDNA.
          Length = 598

 Score =  242 bits (618), Expect = 3e-63
 Identities = 136/184 (73%), Positives = 139/184 (74%), Gaps = 33/184
(17%)
 Frame = +1

Query: 16  PQAGPWRVSA-----PPSGPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDT----
66
           PQA  WR+       P   PPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDT
Sbjct: 31  PQA--WRLDPGEFLHPLQ*PPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDT*V*G
204

Query: 67  -----------------------LLHLFAARGLRWAAYAAAEVLQVYRRLDIREHKGKTP
103
                                  LLHLFAARGLRWAAYAAAEVLQVYRRLDIREHKGKTP
Sbjct: 205 IGLSADSWLGGGCSHGCPPPVLRLLHLFAARGLRWAAYAAAEVLQVYRRLDIREHKGKTP
384

Query: 104 LLVAAAANQPLIVEDLLNLGAEPNAADHQGRSVLHVAATYGLPGV-LAVFKSGIQVDLEA
162
           LLV AAANQPLIVEDLLNLGAEPNAADHQGRSVLHV ATYGLPGV LAV  SG+ V+LEA
Sbjct: 385 LLVVAAANQPLIVEDLLNLGAEPNAADHQGRSVLHVGATYGLPGVLLAVLNSGVHVELEA
564

Query: 163 RDFE 166
           RDFE
Sbjct: 565 RDFE 576

and bassically I want to extract the "Sbjct" lines under every ">"
initiated record
and come out with a file that for the above case will look as follows:

>gi|12383919|gb|BF981107.1|BF981107
EAGPWRVSAPPSGPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDTLLHLFAARGL
RWAAYAAAEVLQVYRRLDIREHKGKTPLLVAAAANQPLIVEDLLNLGAEPNAADHQGRSV
LHVAATYGLPGVLLVWPAGRQ
>gi|12168431|gb|BF825777.1|BF825777
PQAWRLDPGEFLHPLQPPQFPAVVPGPSLEVARAHMLALGPQQLLAQDEEGDTVG
IGLSADSWLGGGCSHGCPPPVLRLLHLFAARGLRWAAYAAAEVLQVYRRLDIREHKGKTP
LLVVAAANQPLIVEDLLNLGAEPNAADHQGRSVLHVGATYGLPGVLLAVLNSGVHVELEA
RDFE

The sequence of strings under the line starting with ">" could  be in a
single line.

The code under these lines is doing something to one of the ">" started
record, but still is not right. Moreover,  I do not know how to make the
program jump from one ">"  record to next one.

Please help.

#!/usr/sbin/perl -w
use strict;
if (!@ARGV) {
    print "usage: $0 blast_output \n";
    exit 0;
}

while (<>) {

if (/(>\S+)\s*/) {
 print "$1\n";
}
next if (/Length/);
next if (/^\s*$/);

if (/Query/) {
 chomp;
 my ($query, $number1, $sequence, $number2) = split;

$sequence =~ tr/-//d;
$sequence.= $sequence;

}
}

print "$sequence\n";



--
***************************************************************************
PEDRO a. RECHE gallardo, pHD            TL: 617 632
3824
Scientist, Mol.Immnunol.Foundation,     FX: 617 632 3351
Dana-Farber Cancer Institute,           EM:
reche@research.dfci.harvard.edu
Harvard Medical School,                 URL: http://www.reche.org
44 Binney Street, D610C,
Boston, MA 02115
***************************************************************************



--------------08C999389F3C3A7954978482--

0
reche
7/13/2001 10:55:17 PM
perl.beginners 29360 articles. 3 followers. Follow

2 Replies
516 Views

Similar Articles

[PageSpeed] 51

At 18:55 13/07/2001 -0400, Pedro A Reche Gallardo wrote:
>HI All, I have a file from a blast report output which looks like the
>following:

<BIG SNIP>

Hi you might want to use the bioperl modules from CPAN to parse BLAST
results - it saves a lot of work.  Check out http://bio.perl.org

HTH HAND

Dan


0
d_c_s
7/13/2001 11:05:33 PM
Sorry maybe I should be a bit more explicit with my links :

http://bio.perl.org/Core/POD/bptutorial.html

Blast.pl and BPlite should help!

dan

0
d_c_s
7/13/2001 11:09:11 PM
Reply:

Similar Artilces:

Integrating do I integrate all help files
How do I integrate PFC, sybase and powerbuilderhelp files together help such that I can get help on all issues (PFC, sybase and powerbuilderhelp ) through powerbuilder's help-content menu only . Please don't cross-post. On 1 Nov 2004 12:34:08 -0700, "Damola adesuyi" <someone@microsoft.com> wrote: >How do I integrate PFC, sybase and powerbuilderhelp files together help such >that I can get help on all issues (PFC, sybase and powerbuilderhelp ) >through powerbuilder's help-content menu only . > Bruce Armstrong [TeamSybase] http://www....

help:about file format
------=_NextPart_000_001D_01E9FEEA.15B33820 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 aG93IHRvIGp1ZGdlIGEgZmlsZSBpbiBkb3MgZm9ybWF0IG9yIGluIHVuaXggZm9ybWF0Pw0KdGhh bmtzIGZvciB5b3VyIHJlc3BvbnNlLg0K ------=_NextPart_000_001D_01E9FEEA.15B33820-- Billy wrote: > > how to judge a file in dos format or in unix format? > thanks for your response. Here is a somewhat simple program that will work with most files. :-) #!/usr/bin/perl use warnings; use strict; open my $fh, $ARGV[0] or die "Cannot open $ARGV[0]: $!&quo...

Help Help Help Help Help Help
------=_NextPart_000_0074_01C2960E.EBE13A30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Can someone please help me. I have installed mysql on Unix Solaris and it works fine I have Perl installed previously which is working and with which i have installed other perlmodules before and are working fine. I have also installed DBI and it works fine with the Sybase drivers which i have installed. When i tried to install the Msql-Mysql-modules-1.2219 drivers i get the following error. # make /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/...

HELP!HELP!HELP!HELP!HELP!HELP!
I was using powerbuilder4.0 a month ago I decided that migrate it to PB7.0 When Im using 4.0, in datawindows I was using extra colums additional to stores procedure. I mean that for example; stored proc. returns 4 columns. I was using 2 extra columns to modify something from client. But I cant do the same thing in PB7.0. How can I do that??? please help. Gurcan yucel gyucel@infina.com.tr "I was using 2 extra columns to modify something from client." what does this mean that you added to the result set? If so then just goto the SQL and add a param. Then set the...

Help with Help File
I have a project that uses the PFC command pfc_help to implement windows level help. I've set the ia_helptypeid for all cases. When I run the application through the PB environment all of the links to the help file work perfectly, but when I create an executable and run it I get the following error message: The help topic does not exist. Contact your application vendor for an updated help file. (129) Is there something I need to include in the resource file when I build the project? Thanks in advance for the help. Cheryl wrote: > > I have a project that uses the ...

Help with formating text file
Hi, I am fairly new to Perl I and need some help. I have text file that has data in this format: Name: Tammy Johnson Address 1:3803 Grenton Ave. City, State: Baltimore, MD Zip: 21206 Name: Ann Johnson Address 1:38 Park Ave. City, State: Baltimore, MD Zip: 21206 I have to convert the data in this format (like a report) Name Address City, State Zip Tammy Johnson 3803 Grenton Ave ...

Class file help I am a beginner
Hello,I have created a class below called test.How would I access my getTimeFunction which I have created in the class below from a page called "webform.aspx" . I haved added "using test"  in webform.aspx but I get errors. I have also tried to add the following<%@ Register TagPrefix="test" Namespace="test" Assembly = "test" %> but it dont workClass below called "test" and saved in "App_code" as "test.cs" sub folderusing System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.W...

RE: HELP FORMATING A FILE
--------------7C493B6032F8333A19482B8F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all, I have found the solution to my "HELP FORMATING A FILE". Actually, I was already very close to the solution. In case someone was interested, here it is the script Regards, Pedro #!/usr/sbin/perl -w #use strict; if (!@ARGV) { print "usage: $0 blast_output \n"; exit 0; } while (<>) { if (/(>\S+)\s*/) { print "$1\n"; } next if (/Length/); next if (/^\s*$/); if (/Sbjct/) { chomp; my ($query,...

Help Help Help Help
i need to create a crosstab report using Crystal reprot for VS 2003 i face aproblem when i need to order my Fileds by their names my data must be like this Basic Cola Housing Gross Deduction1 Deduction2 Deduction3 Net but when i run my report it give my a not sorted data acutally i have acode field which can i order field using it. but i don't knwo how to do thisSo..................? Select Report tab | |-->Select Record Sort expert Choost the fields you want to sort --Select the corresponding sort direction f...

help help help help
Name: chef mario Email: chefusa_at_pacbell.net Product: Firefox Summary: help help help help Comments: Heard great reports about Firefox!!! Downloaded & installed Firefox !!!! Lost All my very very valuable BOOKMARKS!!! CAN ANYONE HELP!!!!! All bookmarks were in Internet Explorer Did bookmark transfer to Firefox. Seem the Fox eat all m,y bookmarks Need serious help anyone. chef mario Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051025 Firefox/1.5 ...

Converting windows txt file format to Linux txt file format
------_=_NextPart_001_01C1BB0F.C70965F0 Content-Type: text/plain; charset="iso-8859-1" Hi everyone I am trying to upload a windows txt file to a Linux server. There are an application running in my Linux server that reads the txt file to extract some information. But the application doesn't recognize the file because it's originally from windows. I know that I could solve it changing the end of line caracters such as line feed and carriage return, but I don't know how to do it. Does anyone know a way to do it using Perl? Thanks in advance. Li...

RES: Converting windows txt file format to Linux txt file format
------_=_NextPart_001_01C1BBD5.E8982DC0 Content-Type: text/plain; charset="iso-8859-1" Yes, Johnathan Now I know it. I didn't know it because Linux and perl are really new to me. Then I thought that I should write a perl script to do it. Thank you. -----Mensagem original----- De: Johnathan Kupferer [mailto:johnathan@gnuthought.com] Enviada em: sexta-feira, 22 de fevereiro de 2002 16:07 Para: Lilian Alvarenga Caravela Godoy Cc: beginners@perl.org Assunto: Re: Converting windows txt file format to Linux txt file format You don't need perl for this. ...

xsl file formatting help required
I have the code listed below in my xsl file which displays my results like so: Item # QuantityCL1022 4Item # QuantityCL1025 5Item # QuantityCL1088 5How can i change my xsl file to display the information like this:Item # QuantityCL1022 4CL1025 5CL1088 5 Xsl Contents<xsl:output method="html" indent="yes"/> <xsl:template match="rootitems"> <xsl:apply-templates select="item" /> </xsl:template>   <xsl:template match="item"> <table width="200px" border="1"> <tr> <td> Item # </td&...

upload multi files, then attach file, then delete files help
Hi, I have a web form that needs do three things in one time when user click "submit" button. 1. upload multi files into web server (In know how to do this part) 2. send a email with these uploaded file to another user. 3. delete these uploaded files from web server. I know how to do 1). But, do not know 2) and 3). I know how to send email without attachment, But, once I add attachments. it does not work. Please help. Many thanks. Xiuxain Hi there, Please check the following links.. Sending Attachments and to delete file .. imports sys...

Web resources about - HELP FORMATING A FILE - perl.beginners

Wikipedia:WikiProject Current Local City Time - Wikipedia, the free encyclopedia
This WikiProject is believed to be inactive. If you are not currently a member of the project, please consider joining it and/or its parent project ...

Wikipedia:WikiProject Current Local City Time - Wikipedia, the free encyclopedia
This WikiProject is believed to be inactive. If you are not currently a member of the project, please consider joining it and/or its parent project ...

Brooker website advert gallery
Our People Affiliations Contact Home Services About Us Positions Resume/CV formating Download an overview of our preferred resume/CV format and ...

Software - Future Shop Community Forums
Discuss software for all types of home or business applications.

AMERICAblog
skip to main skip to sidebar About us - Elections - Gay GOP Primary Schedule - Elections - Romney Economic Crisis - Jobs - TSA - Limbaugh - Fun ...

Wikiful - ARCTABLET NEWS
English (reference page) Translations to be done, your help is needed for the following languages: Korean Completed translations: French , ...

BoardGameGeek - BGG Bugs - Forum - BoardGameGeek
Register Board Games Home Recent Additions Welcome Wiki Subdomains All Abstract Games Customizable Games Children's Games Family Games Party ...

Special Character - Computer, Telephony and Electronics Glossary and Dictionary
Computer, Telephony and Electronics Glossary and Dictionary - CSGNetwork.Com's award winning online glossary of computer, telephony and electronics ...


FileBuzz - Find Software Fast
FileBuzz is your online download destination for Windows, Macintosh, Linux and PDA Freeware, Shareware and Demos.

resources last updated: 11/20/2015 5:19:14 PM