コード例 #1
0
        /// <summary>
        /// Cleans adapter sequences from seqeuences
        /// </summary>
        public override void cleanAdapters()
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            Adapters.getInstance();
            removedAdapters = new Dictionary <int, string>();

            Parallel.For(0, index, new ParallelOptions {
                MaxDegreeOfParallelism = Preferences.getInstance().getCoresToUse()
            },
                         // Initialize the local states
                         () => new FqSequence_IO(sequencerType, "Adapter Removal", this),
                         // Accumulate the thread-local computations in the loop body
                         (i, loop, adapters) =>
            {
                adapters.removedAdapters = fastqSeq[i].cleanAdapters(adapters.adapters, Fq_FILE_MAP);
                return(adapters);
            },
                         adapters =>
            {
                Object locker = new object();
                lock (locker)
                {
                    if (adapters.removedAdapters != null)
                    {
                        removedAdapters.Add(adapters.removedAdapters.SequenceIndex, adapters.removedAdapters.AdapterName);
                    }
                }
            });

            stopwatch.Stop();
            Console.WriteLine("Statistics Performed in " + stopwatch.Elapsed);
        }
コード例 #2
0
 public FqSequence_IO(String sequencerType, String taskType, FqFile_Component fqFile)
 {
     if (taskType == SEQUENCE_TESTS_TASK)
     {
         distributes = new List <int>(40);
         for (int j = 0; j <= SequencerDiscriminator.getSequencerSpecifier(sequencerType).getDistributionSpread(); j++)
         {
             distributes.Add(0);
         }
         perSeqQuals   = new int[fqFile.getMaxSeqSize()];
         subZeroOffset = SequencerDiscriminator.getSequencerSpecifier(sequencerType).getSubZeroQualities();
     }
     else if (taskType == ADAPTER_TASK)
     {
         adapters        = Adapters.getInstance().getAdaptersList();
         removedAdapters = null;
     }
 }