public void InitializeReadMap() { if (FqReadMap == null) { FqReadMap = HashFastq.deserializeHashmap(); } }
/// <summary> /// Constructs the sequencer specific read map by calling the HashFastq class to deserialize it from memory. /// After it is constructed the same class is used to calculate relavent quality scores for each of the nucleotide/quality /// pairings. /// </summary> /// <param name="sequencerType"></param> /// <returns></returns> public Dictionary <int, FqNucleotideRead> ConstructSequencerSpecificReadMap(String sequencerType) { if (FqReadMap == null) { FqReadMap = HashFastq.deserializeHashmap(); } if (isMapConstructed == false) { this.SequencerType = sequencerType; FqReadMap = HashFastq.calculateHashQualities(SequencerType, FqReadMap); isMapConstructed = true; } return(FqReadMap); }
public static void serializeFastqHashmap() { Dictionary <int, FqNucleotideRead> hashmap = HashFastq.createHashMap(); try { using (Stream stream = File.Open(@FQ_FILE_MAP_SERIALIZING_NAME, FileMode.Create)) { BinaryFormatter bin = new BinaryFormatter(); bin.Serialize(stream, hashmap); } } catch (IOException e) { Console.Write("Creation of serialized fastq Fq_FILE_MAP failed \n"); Console.Write(e.StackTrace); } }
/// <summary> /// Calculates the sequencer specific quality scores for each component /// </summary> public override void calculateMapQualities() { Fq_FILE_MAP = HashFastq.calculateHashQualities(sequencerType, Fq_FILE_MAP); }