.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Tools::GuessSeqFormat 3pm" .TH Bio::Tools::GuessSeqFormat 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Tools::GuessSeqFormat \- Module for determining the sequence format of the contents of a file, a string, or through a filehandle. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # To guess the format of a flat file, given a filename: \& my $guesser = Bio::Tools::GuessSeqFormat\->new( \-file => $filename ); \& my $format = $guesser\->guess; \& \& # To guess the format from an already open filehandle: \& my $guesser = Bio::Tools::GuessSeqFormat\->new( \-fh => $filehandle ); \& my $format = $guesser\->guess; \& # The filehandle will be returned to its original position. Note that this \& # filehandle can be STDIN. \& \& # To guess the format of one or several lines of text (with \& # embedded newlines): \& my $guesser = Bio::Tools::GuessSeqFormat\->new( \-text => $linesoftext ); \& my $format = $guesser\->guess; \& \& # To create a Bio::Tools::GuessSeqFormat object and set the \& # filename, filehandle, or line to parse afterwards: \& my $guesser = Bio::Tools::GuessSeqFormat\->new(); \& $guesser\->file($filename); \& $guesser\->fh($filehandle); \& $guesser\->text($linesoftext); \& \& # To guess in one go, given e.g. a filename: \& my $format = Bio::Tools::GuessSeqFormat\->new( \-file => $filename )\->guess; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Bio::Tools::GuessSeqFormat tries to guess the format (\*(L"swiss\*(R", \&\*(L"pir\*(R", \*(L"fasta\*(R" etc.) of the sequence or \s-1MSA\s0 in a file, in a scalar, or through a filehandle. .PP The \fBguess()\fR method of a Bio::Tools::GuessSeqFormat object will examine the data, line by line, until it finds a line to which only one format can be assigned. If no conclusive guess can be made, undef is returned. .PP If the Bio::Tools::GuessSeqFormat object is given a filehandle, e.g. \s-1STDIN,\s0 it will be restored to its original position on return from the \fBguess()\fR method. .SS "Formats" .IX Subsection "Formats" Tests are currently implemented for the following formats: .IP "\(bu" 4 ACeDB (\*(L"ace\*(R") .IP "\(bu" 4 Blast (\*(L"blast\*(R") .IP "\(bu" 4 ClustalW (\*(L"clustalw\*(R") .IP "\(bu" 4 Codata (\*(L"codata\*(R") .IP "\(bu" 4 \&\s-1EMBL\s0 (\*(L"embl\*(R") .IP "\(bu" 4 FastA sequence (\*(L"fasta\*(R") .IP "\(bu" 4 FastQ sequence (\*(L"fastq\*(R") .IP "\(bu" 4 FastXY/FastA alignment (\*(L"fastxy\*(R") .IP "\(bu" 4 Game \s-1XML\s0 (\*(L"game\*(R") .IP "\(bu" 4 \&\s-1GCG\s0 (\*(L"gcg\*(R") .IP "\(bu" 4 \&\s-1GCG\s0 Blast (\*(L"gcgblast\*(R") .IP "\(bu" 4 \&\s-1GCG\s0 FastA (\*(L"gcgfasta\*(R") .IP "\(bu" 4 \&\s-1GDE\s0 (\*(L"gde\*(R") .IP "\(bu" 4 Genbank (\*(L"genbank\*(R") .IP "\(bu" 4 Genscan (\*(L"genscan\*(R") .IP "\(bu" 4 \&\s-1GFF\s0 (\*(L"gff\*(R") .IP "\(bu" 4 \&\s-1HMMER\s0 (\*(L"hmmer\*(R") .IP "\(bu" 4 \&\s-1PAUP/NEXUS\s0 (\*(L"nexus\*(R") .IP "\(bu" 4 Phrap assembly file (\*(L"phrap\*(R") .IP "\(bu" 4 \&\s-1NBRF/PIR\s0 (\*(L"pir\*(R") .IP "\(bu" 4 Mase (\*(L"mase\*(R") .IP "\(bu" 4 Mega (\*(L"mega\*(R") .IP "\(bu" 4 \&\s-1GCG/MSF\s0 (\*(L"msf\*(R") .IP "\(bu" 4 Pfam (\*(L"pfam\*(R") .IP "\(bu" 4 Phylip (\*(L"phylip\*(R") .IP "\(bu" 4 Prodom (\*(L"prodom\*(R") .IP "\(bu" 4 Raw (\*(L"raw\*(R") .IP "\(bu" 4 \&\s-1RSF\s0 (\*(L"rsf\*(R") .IP "\(bu" 4 Selex (\*(L"selex\*(R") .IP "\(bu" 4 Stockholm (\*(L"stockholm\*(R") .IP "\(bu" 4 Swissprot (\*(L"swiss\*(R") .IP "\(bu" 4 Tab (\*(L"tab\*(R") .IP "\(bu" 4 Variant Call Format (\*(L"vcf\*(R") .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR" .IX Header "AUTHOR" Andreas Kähäri, andreas.kahari@ebi.ac.uk .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Heikki Lehväslaiho, heikki-at-bioperl-dot-org Mark A. Jensen, maj-at-fortinbras-dot-us .SH "METHODS" .IX Header "METHODS" Methods available to Bio::Tools::GuessSeqFormat objects are described below. Methods with names beginning with an underscore are considered to be internal. .SS "new" .IX Subsection "new" .Vb 11 \& Title : new \& Usage : $guesser = Bio::Tools::GuessSeqFormat\->new( ... ); \& Function : Creates a new object. \& Example : See SYNOPSIS. \& Returns : A new object. \& Arguments : \-file The filename of the file whose format is to \& be guessed, e.g. STDIN, or \& \-fh An already opened filehandle from which a text \& stream may be read, or \& \-text A scalar containing one or several lines of \& text with embedded newlines. \& \& If more than one of the above arguments are given, they \& are tested in the order \-text, \-file, \-fh, and the first \& available argument will be used. .Ve .SS "file" .IX Subsection "file" .Vb 8 \& Title : file \& Usage : $guesser\->file($filename); \& $filename = $guesser\->file; \& Function : Gets or sets the current filename associated with \& an object. \& Returns : The new filename. \& Arguments : The filename of the file whose format is to be \& guessed. \& \& A call to this method will clear the current filehandle and \& the current lines of text associated with the object. .Ve .SS "fh" .IX Subsection "fh" .Vb 8 \& Title : fh \& Usage : $guesser\->fh($filehandle); \& $filehandle = $guesser\->fh; \& Function : Gets or sets the current filehandle associated with \& an object. \& Returns : The new filehandle. \& Arguments : An already opened filehandle from which a text \& stream may be read. \& \& A call to this method will clear the current filename and \& the current lines of text associated with the object. .Ve .SS "text" .IX Subsection "text" .Vb 8 \& Title : text \& Usage : $guesser\->text($linesoftext); \& $linesofext = $guesser\->text; \& Function : Gets or sets the current text associated with an \& object. \& Returns : The new lines of texts. \& Arguments : A scalar containing one or several lines of text, \& including embedded newlines. \& \& A call to this method will clear the current filename and \& the current filehandle associated with the object. .Ve .SS "guess" .IX Subsection "guess" .Vb 8 \& Title : guess \& Usage : $format = $guesser\->guess; \& @format = $guesser\->guess; # if given a line of text \& Function : Guesses the format of the data accociated with the \& object. \& Returns : A format string such as "swiss" or "pir". If a \& format can not be found, undef is returned. \& Arguments : None. \& \& If the object is associated with a filehandle, the position \& of the filehandle will be returned to its original position \& before the method returns. .Ve .SH "HELPER SUBROUTINES" .IX Header "HELPER SUBROUTINES" All helper subroutines will, given a line of text and the line number of the same line, return 1 if the line possibly is from a file of the type that they perform a test of. .PP A zero return value does not mean that the line is not part of a certain type of file, just that the test did not find any characteristics of that type of file in the line. .SS "_possibly_ace" .IX Subsection "_possibly_ace" From bioperl test data, and from \&\*(L"http://www.isrec.isb\-sib.ch/DEA/module8/B_Stevenson/Practicals/transcriptome_recon/transcriptome_recon.html\*(R". .SS "_possibly_blast" .IX Subsection "_possibly_blast" .Vb 1 \& From various blast results. .Ve .SS "_possibly_bowtie" .IX Subsection "_possibly_bowtie" Contributed by kortsch. .SS "_possibly_clustalw" .IX Subsection "_possibly_clustalw" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_codata" .IX Subsection "_possibly_codata" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_embl" .IX Subsection "_possibly_embl" From \&\*(L"http://www.ebi.ac.uk/embl/Documentation/User_manual/usrman.html#3.3\*(R". .SS "_possibly_fasta" .IX Subsection "_possibly_fasta" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_fastq" .IX Subsection "_possibly_fastq" From bioperl test data. .SS "_possibly_fastxy" .IX Subsection "_possibly_fastxy" From bioperl test data. .SS "_possibly_game" .IX Subsection "_possibly_game" From bioperl testdata. .SS "_possibly_gcg" .IX Subsection "_possibly_gcg" From bioperl, Bio::SeqIO::gcg. .SS "_possibly_gcgblast" .IX Subsection "_possibly_gcgblast" From bioperl testdata. .SS "_possibly_gcgfasta" .IX Subsection "_possibly_gcgfasta" From bioperl testdata. .SS "_possibly_gde" .IX Subsection "_possibly_gde" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_genbank" .IX Subsection "_possibly_genbank" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". Format of [apparantly optional] file header from \&\*(L"http://www.umdnj.edu/rcompweb/PA/Notes/GenbankFF.htm\*(R". (\s-1TODO:\s0 dead link) .SS "_possibly_genscan" .IX Subsection "_possibly_genscan" From bioperl test data. .SS "_possibly_gff" .IX Subsection "_possibly_gff" From bioperl test data. .SS "_possibly_hmmer" .IX Subsection "_possibly_hmmer" From bioperl test data. .SS "_possibly_nexus" .IX Subsection "_possibly_nexus" From \*(L"http://paup.csit.fsu.edu/nfiles.html\*(R". .SS "_possibly_mase" .IX Subsection "_possibly_mase" From bioperl test data. More detail from \*(L"http://www.umdnj.edu/rcompweb/PA/Notes/GenbankFF.htm\*(R" (\s-1TODO:\s0 dead link) .SS "_possibly_mega" .IX Subsection "_possibly_mega" From the ensembl broswer (AlignView data export). .SS "_possibly_msf" .IX Subsection "_possibly_msf" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_phrap" .IX Subsection "_possibly_phrap" From \*(L"http://biodata.ccgb.umn.edu/docs/contigimage.html\*(R". (\s-1TODO:\s0 dead link) From \*(L"http://genetics.gene.cwru.edu/gene508/Lec6.htm\*(R". (\s-1TODO:\s0 dead link) From bioperl test data (\*(L"*.ace.1\*(R" files). .SS "_possibly_pir" .IX Subsection "_possibly_pir" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". The \*(L".,()\*(R" spotted in bioperl test data. .SS "_possibly_pfam" .IX Subsection "_possibly_pfam" From bioperl test data. .SS "_possibly_phylip" .IX Subsection "_possibly_phylip" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". Initial space allowed on first line (spotted in ensembl AlignView exported data). .SS "_possibly_prodom" .IX Subsection "_possibly_prodom" From \*(L"http://prodom.prabi.fr/prodom/current/documentation/data.php\*(R". .SS "_possibly_raw" .IX Subsection "_possibly_raw" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_rsf" .IX Subsection "_possibly_rsf" From \*(L"http://www.ebi.ac.uk/help/formats.html\*(R". .SS "_possibly_selex" .IX Subsection "_possibly_selex" From \*(L"http://www.ebc.ee/WWW/hmmer2\-html/node27.html\*(R". .PP Assuming presence of Selex file header. Data exported by Bioperl on Pfam and Selex formats are identical, but Pfam file only holds one alignment. .SS "_possibly_stockholm" .IX Subsection "_possibly_stockholm" From bioperl test data. .SS "_possibly_swiss" .IX Subsection "_possibly_swiss" From \*(L"http://ca.expasy.org/sprot/userman.html#entrystruc\*(R". .SS "_possibly_tab" .IX Subsection "_possibly_tab" Contributed by Heikki. .SS "_possibly_vcf" .IX Subsection "_possibly_vcf" From \*(L"http://www.1000genomes.org/wiki/analysis/vcf4.0\*(R". .PP Assumptions made about sanity \- format and date lines are line 1 and 2 respectively. This is not specified in the format document.