[Bioperl-guts-l] bioperl commit

Ed Green edgreen at pub.open-bio.org
Mon Mar 22 20:00:46 EST 2004


edgreen
Mon Mar 22 20:00:46 EST 2004
Update of /home/repository/bioperl/bioperl-live/Bio/Structure/SecStr/DSSP
In directory pub.open-bio.org:/tmp/cvs-serv20071

Modified Files:
	Res.pm 
Log Message:
Updated DSSP parser to successfully deal with DSSP output generated from
ATOM-line only input files.  

bioperl-live/Bio/Structure/SecStr/DSSP Res.pm,1.4,1.5
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Structure/SecStr/DSSP/Res.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/bioperl/bioperl-live/Bio/Structure/SecStr/DSSP/Res.pm	2003/05/17 19:03:57	1.4
+++ /home/repository/bioperl/bioperl-live/Bio/Structure/SecStr/DSSP/Res.pm	2004/03/23 01:00:46	1.5
@@ -1,4 +1,4 @@
-# $id $
+# $Header$
 #
 # bioperl module for Bio::Structure::SecStr::DSSP::Res.pm
 #
@@ -1216,37 +1216,62 @@
 	return;
     }
 
+    # REFERENCE line (always there)
     $cur = <$file>;
     ( $element ) = ( $cur =~ /^REFERENCE\s+(.+?)\s+\./ );
     $head{ 'REFERENCE' } = $element;
 
     $cur = <$file>;
-    @elements = split( /\s+/, $cur );
-    pop( @elements ); # take off that annoying period
-    $head{ 'PDB' } = pop( @elements );
-    $head{ 'DATE' } = pop( @elements );
-    # now, everything else is "header" except for the word
-    # HEADER
-    shift( @elements );
-    $element = shift( @elements );
-    while ( @elements ) {
-	$element = $element." ".shift( @elements );
+    # Check for HEADER line (not always there)
+    if ( $cur =~ /^HEADER\s/ ) {
+	@elements = split( /\s+/, $cur );
+	pop( @elements ); # take off that annoying period
+	$head{ 'PDB' } = pop( @elements );
+	$head{ 'DATE' } = pop( @elements );
+	# now, everything else is "header" except for the word
+	# HEADER
+	shift( @elements );
+	$element = shift( @elements );
+	while ( @elements ) {
+	    $element = $element." ".shift( @elements );
+	}
+	$head{ 'HEADER' } = $element;
+	
+	$cur = <$file>;
     }
-    $head{ 'HEADER' } = $element;
 
-    $cur = <$file>;
-    ($element) = ( $cur =~ /^COMPND\s+(.+?)\s+\./ );
-    $head{ 'COMPND' } = $element;
+    # Check for COMPND line (not always there)
+    if ( $cur =~ /^COMPND\s/ ) {
+	($element) = ( $cur =~ /^COMPND\s+(.+?)\s+\./ );
+	$head{ 'COMPND' } = $element;
+	
+	$cur = <$file>;
+    }
 
-    $cur = <$file>;
-    ($element) = ( $cur =~ /^PDBSOURCE\s+(.+?)\s+\./ );
-    $head{ 'SOURCE' } = $element;
+    # Check for SOURCE or PDBSOURCE line (not always there)
+    if ( $cur =~ /^PDBSOURCE\s/ ) {
+	($element) = ( $cur =~ /^PDBSOURCE\s+(.+?)\s+\./ );
+	$head{ 'SOURCE' } = $element;
+	
+	$cur = <$file>;
+    }
 
-    $cur = <$file>;
-    ($element) = ( $cur =~ /^AUTHOR\s+(.+?)\s+/ );
-    $head{ 'AUTHOR' } = $element;
+    elsif ( $cur =~ /^SOURCE\s/ ) {
+	($element) = ( $cur =~ /^SOURCE\s+(.+?)\s+\./ );
+	$head{ 'SOURCE' } = $element;
 	
-    $cur = <$file>;
+	$cur = <$file>;
+    }
+
+    # Check for AUTHOR line (not always there)
+    if ( $cur =~ /^AUTHOR/ ) {
+	($element) = ( $cur =~ /^AUTHOR\s+(.+?)\s+/ );
+	$head{ 'AUTHOR' } = $element;
+
+	$cur = <$file>;
+    }
+
+    # A B C D E TOTAL NUMBER OF RESIDUES, NUMBER ... line
     @elements = split( /\s+/, $cur );
     shift( @elements );
     $head{ 'TotNumRes' } = shift( @elements );



More information about the Bioperl-guts-l mailing list