roblanf / sangeranalyseR

functions to analyse sanger sequencing reads in R
MIT License
95 stars 24 forks source link

M2trimming: error when handling low quality file #91

Open ryamy opened 1 year ago

ryamy commented 1 year ago

Thanks for your work, it really useful for me to analyze ABIF format data. When SangerRead handle low quality data by M2 trimming, following error is produced. These input files have low quality and primary sequence contains only few 'N's. I would appreciate if you could add some logic to skip analysis of this kind of data. Thanks!

image

> 
+ SangerRead(readFeature          =  'Forward Read',
+            readFileName         =  f,
+            geneticCode          =  GENETIC_CODE,
+            TrimmingMethod       = 'M2',
+            M1TrimmingCutoff     = 1e-4,
+            M2CutoffQualityScore =  55,
+            M2SlidingWindowSize  =  20,
+            baseNumPerRow        = 100,
+            heightPerRow         = 200,
+            signalRatioCutoff    = 0.33,
+            showTrimmed          = TRUE)
+ 
INFO [2023-03-23 08:36:45] ------------------------------------------------
INFO [2023-03-23 08:36:45] -------- Creating 'SangerRead' instance --------
INFO [2023-03-23 08:36:45] ------------------------------------------------
INFO [2023-03-23 08:36:45] >> Forward Read: Creating abif & sangerseq ...
INFO [2023-03-23 08:36:45]     >> Creating Forward Read raw abif ...
INFO [2023-03-23 08:36:45]     >> Creating Forward Read raw sangerseq ...
INFO [2023-03-23 08:36:45]           * Making basecall !!
INFO [2023-03-23 08:36:45]           * Updating slots in 'SangerRead' instance !!
Error in seq_len((rawSeqLength - M2SlidingWindowSize + 1)) : 
  argument must be coercible to non-negative integer
>