README.md in parse_fasta-2.0.1 vs README.md in parse_fasta-2.1.0
- old
+ new
@@ -57,15 +57,31 @@
The `Record#desc` and `Record#qual` will be `nil` if the file you are parsing is a fastA file.
```ruby
ParseFasta::SeqFile.open(ARGV[0]).each_record do |rec|
if rec.qual
- puts "@#{rec.header}"
- puts rec.seq
- puts "+#{rec.desc}"
- puts rec.qual
+ # it's a fastQ record
else
- puts ">#{rec.header}"
- puts rec.sequence
+ # it's a fastA record
end
end
-```
\ No newline at end of file
+```
+
+You can also check this with `Record#fastq?`
+
+```ruby
+ParseFasta::SeqFile.open(ARGV[0]).each_record do |rec|
+ if rec.fastq?
+ # it's a fastQ record
+ else
+ # it's a fastA record
+ end
+end
+```
+
+And there is a nice `#to_s` method, that does what it should whether the record is fastA or fastQ like. Check out the docs for info on the fancy `#to_fasta` and `#to_fastq` methods!
+
+```ruby
+ParseFasta::SeqFile.open(ARGV[0]).each_record do |rec|
+ puts rec.to_s
+end
+```