You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _wikis/BioJava3:HowTo.mediawiki
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,9 +124,19 @@ All the examples in this section require the biojava-dna module.
124
124
125
125
The examples in this section require the biojava-fasta module. The examples that deal with converting to/from DNA sequences also require the biojava-dna module.
126
126
127
-
At some point, convenience wrapper classes will be added to make the parsing process simpler for the most common use-cases.
127
+
Convenience wrapper classes are provided to make the parsing process simpler for the most common use-cases.
128
128
129
-
=== Parsing a FASTA file ===
129
+
=== Parsing a FASTA file (the easy way) ===
130
+
131
+
ThingParser<FASTA> parser = ThingParserFactory.
132
+
getReadParser(FASTA.format, new File("/path/to/my/fasta.fa"));
133
+
while (parser.hasNext()) {
134
+
FASTA fasta = parser.next();
135
+
// fasta contains a complete FASTA record.
136
+
}
137
+
reader.close();
138
+
139
+
=== Parsing a FASTA file (the hard way) ===
130
140
131
141
FASTAReader reader = new FASTAFileReader(new File("/path/to/my/fasta.fa"));
132
142
FASTABuilder builder = new FASTABuilder();
@@ -147,7 +157,14 @@ At some point, convenience wrapper classes will be added to make the parsing pro
0 commit comments