LooseLab / readfish

CLI tool for flexible and fast adaptive sampling on ONT sequencers
https://looselab.github.io/readfish/
GNU General Public License v3.0
167 stars 31 forks source link

Odd and even field #224

Closed ylang0825 closed 1 year ago

ylang0825 commented 1 year ago

Hi everyone, Recently I need to perform a readfish run and a non-adaptive control run on one flowcell simultaneously, eg. readfish run on odd-numbered channels and control run on even-numbered channels. I noticed that the developers had updated a ru/ directory, which seemed to have achieved different operations for odd and even channels. From the code, I tried adding "odd_even = true" to 'conditions.0' or 'conditions' in the toml file but the 'readfish validate' command told me this was an illegal item. I wonder if this function has been added to the current version of readfish? If not, is there a way to achieve that?

Many thanks! Lang Yang

alexomics commented 1 year ago

The --odd-even flag is only available to barcoded experiments at the moment as an experimental feature for control/analysis channels as this was not carried over when I implemented barcode-aware readfish. If you are running readfish barcode-targets ... then you can use the --odd-even flag with the current version (0.0.11a3, 0ccb593) of readfish.

If you are using readfish targets ... the way to specify 50% of the flow cell as a control region is by using the experiment TOML like so:

[caller_settings]
...

[conditions]
reference = "/path/to/reference.mmi"

[conditions.0]
name = "Control"
control = true
min_chunks = 0
max_chunks = 2
targets = []
single_on = "stop_receiving"
multi_on = "stop_receiving"
single_off = "stop_receiving"
multi_off = "stop_receiving"
no_seq = "stop_receiving"
no_map = "stop_receiving"

[conditions.1]
name = "Analysis"
control = false
min_chunks = 0
max_chunks = 2
targets = ["chr21", "chr22"]
single_on = "stop_receiving"
multi_on = "stop_receiving"
single_off = "unblock"
multi_off = "unblock"
no_seq = "proceed"
no_map = "proceed"
ylang0825 commented 1 year ago

Great! Thanks!

ylang0825 commented 1 year ago

Hi Alex, I followed your suggestions. But I found something weird. I analyzed the sequencing summay text file and found all "data_service_unblock_mux_change" reads' channel numbers were >= 321 or <= 64. It seemed that 64 to 321 channels (total 256 channels) were set as adaptive and the left as control. Although 256 channels were exact half of whole 512 channels, which meets my need, but the channel interval is so weird. I wonder if this is correct?

Thanks!

alexomics commented 1 year ago

This is expected, when using the conditions.# format in the TOML file readfish will split the flow cell based on channel position. E.G:

 +-------------------+    +-------------------+
 |                   |    |         |         |
 |                   | -> |         |         |
 |                   |    |         |         |
 +-------------------+    +-------------------+

As the channel numbers are not sequential across the flow cell the regions don't split into nice ranges but as you say there are 256 channels in each condition!