Skip to content

Commit 1ba1122

Browse files
foisysandreasprlic
authored andcommitted
/* Tools for reading/writing files */
1 parent a3c5fdc commit 1ba1122

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

wiki/BioJava:BioJavaXDocs.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,16 @@ Here is an example of using the RichSequence.IOTools methods. The
599599
example reads a file in Genbank format containing some DNA sequences,
600600
then prints them out to standard out (the screen) in EMBL format:
601601

602-
<java> BufferedReader br = new BufferedReader(new
603-
FileReader("myGenbank.gbk")); // an input GenBank file Namespace ns =
604-
RichObjectFactory.getDefaultNamespace(); // a namespace to override that
605-
in the file RichSequenceIterator seqs =
606-
RichSequence.IOTools.readGenbankDNA(br,ns); // we are reading DNA
607-
sequences while (seqs.hasNext()) {
602+
<java> // an input GenBank file BufferedReader br = new
603+
BufferedReader(new FileReader("myGenbank.gbk")); // a namespace to
604+
override that in the file Namespace ns =
605+
RichObjectFactory.getDefaultNamespace(); // we are reading DNA sequences
606+
RichSequenceIterator seqs = RichSequence.IOTools.readGenbankDNA(br,ns);
607+
while (seqs.hasNext()) {
608608

609609
`   RichSequence rs = seqs.nextRichSequence();`
610-
`   RichSequence.IOTools.writeEMBL(System.out, rs, ns);                   // write it in EMBL format to standard out`
610+
`   // write it in EMBL format to standard out`
611+
`   RichSequence.IOTools.writeEMBL(System.out, rs, ns);                   `
611612

612613
} </java>
613614

wiki/BioJava:BioJavaXDocs.mediawiki

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,16 @@ The tools can all be found in RichSequence.IOTools, a subclass of the RichSequen
463463
Here is an example of using the RichSequence.IOTools methods. The example reads a file in Genbank format containing some DNA sequences, then prints them out to standard out (the screen) in EMBL format:
464464

465465
<java>
466-
BufferedReader br = new BufferedReader(new FileReader("myGenbank.gbk")); // an input GenBank file
467-
Namespace ns = RichObjectFactory.getDefaultNamespace(); // a namespace to override that in the file
468-
RichSequenceIterator seqs = RichSequence.IOTools.readGenbankDNA(br,ns); // we are reading DNA sequences
466+
// an input GenBank file
467+
BufferedReader br = new BufferedReader(new FileReader("myGenbank.gbk"));
468+
// a namespace to override that in the file
469+
Namespace ns = RichObjectFactory.getDefaultNamespace();
470+
// we are reading DNA sequences
471+
RichSequenceIterator seqs = RichSequence.IOTools.readGenbankDNA(br,ns);
469472
while (seqs.hasNext()) {
470473
RichSequence rs = seqs.nextRichSequence();
471-
RichSequence.IOTools.writeEMBL(System.out, rs, ns); // write it in EMBL format to standard out
474+
// write it in EMBL format to standard out
475+
RichSequence.IOTools.writeEMBL(System.out, rs, ns);
472476
}
473477
</java>
474478

0 commit comments

Comments
 (0)