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, $number1, $sequence, $number2) = split;
$sequence =~ tr/-//d;
print "$sequence\n";
}
}



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
***************************************************************************



--------------7C493B6032F8333A19482B8F--

0
reche
7/17/2001 11:36:07 PM
perl.beginners.cgi 3839 articles. 0 followers. Follow

0 Replies
3044 Views

Similar Articles

[PageSpeed] 44

Reply:

Similar Artilces:

[moonbuzz@gmail.com: Re: Help using cgi]Re: Help using cgi
On Mon, Apr 11, 2011 at 04:05:31AM -0700, prashant kaushal wrote: > Hi Di, > > Yesterday i tried a "Hello world" program in perl using cgi script on a windows platform. The steps i followed were: > > 1. Made a directory in "C:" and named it "cgi-bin" > 2. Wrote my source code file and saved it with "test.cgi" > That won't do, you need to configure a webserver to execute that code. There are 2 ways to go about it: 1: install Apache, you can find a ready-to-go distribution at http://apachefriends.org 2: configure...

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....

RE: [OT]Re: log file -help
Raghavan Can you re-write the same functionality in the perl pgm since i cudn't find any mailing list for shell wud be appreicated ur reply asap rgds venkat -----Original Message----- From: Sudarshan Raghavan [mailto:sraghava@kyocera-wireless.com] Sent: Tuesday, 1 July 2003 4:44 PM To: Vema Venkata Subject: Re: [OT]Re: log file -help Vema Venkata wrote: >raghavan, >sorry to bother u. > >since i was new to this domain.. >can you let me know how did you make out it is shell not perl? >ur reply is most appreicated. > The if - fi construct, con...

Re: RE: Beginner Help Please- Oracle How To?
My apologies for being vague. I have the client sw installed. I can connect and work with my databases via SQLPlus just fine. The issue Im having is I understand I need DBD::Oracle. I cant find it. If I go into ppm and do a search Oracle, I get: 1. Class-DBI-Oracle 2. Class-DBI-Oracle 3. DBIx-OracleLogin 4. DBIx-OracleLogin 5. DDL-Oracle not a DBD::Oracle in sight. OK. Where do I get this module from? ----- Original Message ----- From: Bob Showalter <Bob_Showalter@taylorwhite.com> Date: Friday, October 10, 2003 10:53 am Subject: RE: Beginner Help Please- ...

RFL File Location, was Re: HELP, HELP ! ! !
>According to Novell recommendations I've configured the eMBox client to >enable roll forwarded logging and to save logs onto other volume than sys on >a NW 6.5 sp1 server. > >Everything was fine until normal server's restart when I got error -6024: >could not open local database. When I copy RFL log files from the other >volume to sys:\_netware\nds.rfl directory and restart server local database >opens. > >My question is: why do I get this 6024 error after normal server's restart? > >Sinisa Did any of this get resolved? I'...

Re: Re: Help with ODBC/CGI/IIS
Yes, by all means get out of the registry. There are so many other ways to set your stuff up. Unless of course you really like that sort of thing. Here is a link from MS on IIS. It may help: http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/iis/tips/iis5chk.asp IIS 5 Overview and tips: http://www.microsoft.com/windows2000/en/server/iis/ I have also used some of MS's lookdown tools and other utilities. I have those links too if you want them. Mark -----Original Message----- From: "Al Hospers"<al@cambersoft.com> To: "'...

RE: Spam:Re: File Upload Using CGI
G'day... > $file_name =3D $upload->file_name('sequences'); > $file_type =3D $uplaod->file_type('sequences'); >=20 > $file_handle =3D $upload->file_handle('sequences'); I haven't checked your script that thoroughly, or compared it to how I have done it - /but/ I have noticed that you've misspelt "upload" as "uplaod" in the 2nd quoted line above. This may be the source of your problems. HTH Regards, =20 Michael S. E. Kraus Software Developer Wild Technology Pty Ltd ____________________________...

Re: B/C
---------- Forwarded message ---------- Date: Fri, 19 Apr 2002 19:06:30 -0400 (EDT) From: Jeff 'japhy' Pinyan <jeffp@crusoe.net> Reply-To: japhy@pobox.com To: drieux <drieux@wetware.com> Subject: Re: B/C - Re: help parsing file On Apr 19, drieux said: >> while (<FH>) { >> next unless /^$prefix/; >> $_ .= <FH> while /^$prefix/gm; >> print; >> } > >why is it that when I try to do this - my perldebugger >goes out to lunch... Because I messed up. I never actually ran that code -- it was wha...

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 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...

Re: Encrypt a file, was Re: Encrpt a file
On Mon, 18 Apr 2005, Anish Kumar K wrote: > Can [anyone] suggest a good algorithm for [encrypting] and > [decrypting] files ..I donot want to use any perl module for that... Check out the perl stuff on this site. I haven't actually used it yet, though I've been meaning to look at it. But their Java stuff is really good. http://www.cryptix.org/ Not sure why you don't want to use a module, but you could always pull out the parts you need. ****** CONFIDENTIALITY NOTICE ****** NOTICE: This e-mail message and all attachments transmitted with it may con...

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...

Re:Re: Help
No. I send the message but don�t appear as answer. you are sending now so i wouldn't worry about it. Also, it takes a minute or two to appear. Austin "Miguel" <macrmail@yahoo.com> wrote in message news:9vYEYtD2CHA.312@forums.sybase.com... > No. I send the message but don�t appear as answer. > > ...

Web resources about - RE: HELP FORMATING A FILE - perl.beginners.cgi

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: 1/1/2016 8:53:41 PM