"Youens-Clark, Charles Kenneth - (kyclark)" <kycl...@email.arizona.edu>
writes:

>> import Bio.Core.Sequence

I don't think you need this one, it is reexported by FastQ below:

>> import Bio.Sequence.FastQ

>> main = do
>>     (file:args) <- getArgs
>>     seqs <- readSangerQ file
>>     let first = head seqs
>>     let label = seqid first
>>     putStrLn $ ">" ++ BC.unpack (unSL label)
>>     putStrLn $ BC.unpack (unSD $ seqdata first)

>>     --qual <- BC.unpack (unQD $ seqqual first)
>>     --putStrLn ">>" ++ qual ++ "<<“

   let qual = .... (i.e. no <-, this is not an IO operation)

> First off, I’d appreciate any pointers on how to do this better.

If this is all you want to do, you can use "toFasta" and "toFastaQual".

Since SeqLable and SeqData are instances of Stringable, you can use
"toString", so

   let label = toString (seqid first)

thus no need to import ByteString.  E.g.

   putStrLn (">"++toString (seqid first)++"\n"++toString (seqdata first))

> Second, I don’t understand how to get the quality data as a list of integer 
> values.

For qualdata, you need to use ByteString without Char8, that is
B.unpack.  This will give you a list of Word8s.

You can also use map (Data.Char.)ord in combination with toString to get
the integer values (and avoid ByteString).

Sorry about the late answer.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
  • Parsing FASTQ Youens-Clark, Charles Kenneth - (kyclark)
    • Re: Parsing FASTQ Ketil Malde

Reply via email to