moduleBio.Sequence.PhdDatawhereimportData.Maybe(fromJust)importBio.Core.SequenceimportqualifiedBio.Sequence.PhdTagasPTimportqualifiedData.ByteString.LazyasLBimportqualifiedData.ByteString.Lazy.Char8asLBC{-- A .phd file consists of a DNA block with base and quality
values, followed by one or more (optional) tag blocks. --}dataPhd=Phd{comment::Comment,dnaBlock::DNABlock,phdTags::Maybe[PT.PhdTag]}deriving(Show){-- These types are subject to change if it improves functionality,
but for now it's simplest to just call them String, Int etc.--}dataComment=Comment{chromatFile::FilePath,abiThumbprint::String,phredVersion::String,callMethod::String,qualityLevels::Int,time::String,traceArrayMinIndex::Int,traceArrayMaxIndex::Int,trim::MaybeString,chem::String,dye::String}deriving(Eq)instanceShowCommentwhereshow(Commentcfabitpvcmqltimintaimaxtaitrchdy)=("\n"++)$unlines["CHROMAT_FILE: "++cf,"ABI_THUMBPRINT: "++abit,"PHRED_VERSION: "++pv,"CALL_METHOD: "++cm,"QUALITY_LEVELS: "++showql,"TIME: "++showti,"TRACE_ARRAY_MIN_INDEX: "++showmintai,"TRACE_ARRAY_MAX_INDEX: "++showmaxtai,"TRIM: "++if(tr==Nothing)then""elsefromJusttr,"CHEM: "++ch,"DYE: "++dy]dataDNABlock=DNABlock{label::String,bases::SeqData,qualities::QualData,traceIndices::[Int]}instanceShowDNABlockwhereshow=LBC.unpack.toFastainstanceBioSeqDNABlockwhereseqlabeldb=SeqLabel$LBC.pack$labeldbseqdatadb=basesdbseqlengthdb=Offset$LBC.length$unSD$basesdbinstanceBioSeqQualDNABlockwhereseqqual=qualities-- Some default values for the data types, useful for debugging in ghcidefaultComment=Comment{chromatFile="",abiThumbprint="0",phredVersion="0.980904.e",callMethod="phred",qualityLevels=99,time="",traceArrayMinIndex=0,traceArrayMaxIndex=1,trim=Nothing,chem="unknown",dye="unknown"}defaultDNABlock=DNABlock{label="some_dna",bases=SeqData$LBC.pack"aatgcatcta",qualities=QualData$LBC.pack"0000000000",traceIndices=[0,1,2,3,4,5,6,7,8,9,10]}defaultPhdTag=PT.PhdTag{PT.tagType="polymorphism",PT.source="polyphred",PT.unpaddedReadPosition=[5,5],PT.date="01/01/70 00:00:00",PT.comment=""}