CLI Logic¶
The following page describes the API of the logic module.
Warning
The logic module has been introduced as an experimetal feature in version 0.12.0, we forecast that its API and design will chnge considerably in future varsions.
The logic module offers the possibility to user to easily change the logic used to count “spliced”, “unspliced”, “ambiguous” molecules, without requiring a complete rewrite of the all pipeline. This might be desired to adapt velocyto to different technology or to introduce new rules and heuristics to make the counting more accurate or sensitive.
velocyto.logic module¶

class
velocyto.logic.
Logic
→ None[source]¶ Bases:
object
Base class from wich all the logics should inherit

layers
¶

count
(molitem: velocyto.molitem.Molitem, cell_bcidx: int, spliced: numpy.ndarray, unspliced: numpy.ndarray, ambiguous: numpy.ndarray, geneid2ix: Dict[str, int]) → None[source]¶ This methods will have to countain the core operatios of the logic to attribute a molecule to one of the cathergories
Parameters:  molitem (vcy.Molitem) – The
vcy.Molitem
object to be considered by the logic  cell_bcidx (int) – The cell index in the memory buffers below
 spliced (np.ndarray,) – The memory buffer that will be saved in the loom file after counting
 unspliced (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 ambiguous (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 geneid2ix (Dict[str, int]) – Dictionary containing the Acession of the genes mapping to its column index position
Returns: Return type: Nothing but it adds the molecule to the appropriate layer (or does not count at all)
Note
I need to generalize this to any set of layers: instead of spliced, unspliced and ambiguous np.ndarray a dictionary {“name_layer”: np.ndarray} should be passed
 molitem (vcy.Molitem) – The


class
velocyto.logic.
Permissive10X
→ None[source]¶ Bases:
velocyto.logic.Logic
Permissive logic for 10X Genomics chemistry
This logic differs from the other 10x Logics because:  singletons if the fall in not validated introns are COUNTED UNSPLICED  singletons if the fall in validated introns are COUNTED UNSPLICED  nonsingletons if are supported by not validated introns are COUNTED UNSPLICED  nonsingletons if are supported by validated introns are COUNTED UNSPLICED

layers
¶

count
(molitem: velocyto.molitem.Molitem, cell_bcidx: int, spliced: numpy.ndarray, unspliced: numpy.ndarray, ambiguous: numpy.ndarray, geneid2ix: Dict[str, int]) → None[source]¶ This methods will have to countain the core operatios of the logic to attribute a molecule to one of the cathergories
Parameters:  molitem (vcy.Molitem) – The
vcy.Molitem
object to be considered by the logic  cell_bcidx (int) – The cell index in the memory buffers below
 spliced (np.ndarray,) – The memory buffer that will be saved in the loom file after counting
 unspliced (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 ambiguous (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 geneid2ix (Dict[str, int]) – Dictionary containing the Acession of the genes mapping to its column index position
Returns: Return type: Nothing but it adds the molecule to the appropriate layer (or does not count at all)
Note
I need to generalize this to any set of layers: instead of spliced, unspliced and ambiguous np.ndarray a dictionary {“name_layer”: np.ndarray} should be passed
 molitem (vcy.Molitem) – The


class
velocyto.logic.
ValidatedIntrons10X
→ None[source]¶ Bases:
velocyto.logic.Logic
ValidatedIntrons logic for 10X Genomics chemistry
This differs from the other 10x Logics because:  singletons if the fall in not validated introns are DISCARDED  singletons if the fall in validated introns are COUNTED UNSPLICED  nonsingletons if are supported by not validated introns are DISCARDED  nonsingletons if are supported by validated introns are COUNTED UNSPLICED

layers
¶

count
(molitem: velocyto.molitem.Molitem, cell_bcidx: int, spliced: numpy.ndarray, unspliced: numpy.ndarray, ambiguous: numpy.ndarray, geneid2ix: Dict[str, int]) → None[source]¶ This methods will have to countain the core operatios of the logic to attribute a molecule to one of the cathergories
Parameters:  molitem (vcy.Molitem) – The
vcy.Molitem
object to be considered by the logic  cell_bcidx (int) – The cell index in the memory buffers below
 spliced (np.ndarray,) – The memory buffer that will be saved in the loom file after counting
 unspliced (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 ambiguous (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 geneid2ix (Dict[str, int]) – Dictionary containing the Acession of the genes mapping to its column index position
Returns: Return type: Nothing but it adds the molecule to the appropriate layer (or does not count at all)
Note
I need to generalize this to any set of layers: instead of spliced, unspliced and ambiguous np.ndarray a dictionary {“name_layer”: np.ndarray} should be passed
 molitem (vcy.Molitem) – The


class
velocyto.logic.
Stricter10X
→ None[source]¶ Bases:
velocyto.logic.Logic
Stricter logic for 10X Genomics chemistry
This differ from the other 10x Logics because:  singletons if the fall in not validated introns are DISCARDED  singletons if the fall in validated introns are DISCARDED  nonsingletons if are supported by not validated introns are DISCARDED  nonsingletons if are supported by validated introns are COUNTED UNSPLICED

layers
¶

count
(molitem: velocyto.molitem.Molitem, cell_bcidx: int, spliced: numpy.ndarray, unspliced: numpy.ndarray, ambiguous: numpy.ndarray, geneid2ix: Dict[str, int]) → None[source]¶ This methods will have to countain the core operatios of the logic to attribute a molecule to one of the cathergories
Parameters:  molitem (vcy.Molitem) – The
vcy.Molitem
object to be considered by the logic  cell_bcidx (int) – The cell index in the memory buffers below
 spliced (np.ndarray,) – The memory buffer that will be saved in the loom file after counting
 unspliced (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 ambiguous (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 geneid2ix (Dict[str, int]) – Dictionary containing the Acession of the genes mapping to its column index position
Returns: Return type: Nothing but it adds the molecule to the appropriate layer (or does not count at all)
Note
I need to generalize this to any set of layers: instead of spliced, unspliced and ambiguous np.ndarray a dictionary {“name_layer”: np.ndarray} should be passed
 molitem (vcy.Molitem) – The


class
velocyto.logic.
ObservedSpanning10X
→ None[source]¶ Bases:
velocyto.logic.Logic
ObservedSpanning10X logic for 10X Genomics chemistry
This differ from the other 10x Logics because:  singletons if the fall in not validated introns are DISCARDED  singletons if the fall in validated introns are DISCARDED  nonsingletons if are supported by not validated introns are DISCARDED  nonsingletons if are supported by validated introns are DISCARDED  Therefore only the observed intron spanning reads are counted as UNSPLICED

layers
¶

count
(molitem: velocyto.molitem.Molitem, cell_bcidx: int, spliced: numpy.ndarray, unspliced: numpy.ndarray, ambiguous: numpy.ndarray, geneid2ix: Dict[str, int]) → None[source]¶ This methods will have to countain the core operatios of the logic to attribute a molecule to one of the cathergories
Parameters:  molitem (vcy.Molitem) – The
vcy.Molitem
object to be considered by the logic  cell_bcidx (int) – The cell index in the memory buffers below
 spliced (np.ndarray,) – The memory buffer that will be saved in the loom file after counting
 unspliced (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 ambiguous (np.ndarray) – The memory buffer that will be saved in the loom file after counting
 geneid2ix (Dict[str, int]) – Dictionary containing the Acession of the genes mapping to its column index position
Returns: Return type: Nothing but it adds the molecule to the appropriate layer (or does not count at all)
Note
I need to generalize this to any set of layers: instead of spliced, unspliced and ambiguous np.ndarray a dictionary {“name_layer”: np.ndarray} should be passed
 molitem (vcy.Molitem) – The


velocyto.logic.
Default
¶ alias of
velocyto.logic.ValidatedIntrons10X