redefineTypeByName: Retype neurons according to a grep pattern to be run on names

Description Usage Arguments Details Examples

View source: R/retyping.R

Description

Retype neurons according to a grep pattern to be run on names

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
redefineTypeByName(
  connections,
  typeList = NULL,
  pattern = NULL,
  sets = NULL,
  nameModifiers,
  postfix = c("raw", "to", "from"),
  redefinePartners = FALSE,
  perl = FALSE
)

Arguments

connections

Connectivity table or neuronBag to modify

typeList

: which types to lateralize (by default all the neurons which names contains L or R)

pattern

A grep pattern to be run to match a "name" column

sets

List of neuron name sets. To be used in place of pattern.

nameModifiers

A vector of strings of lenght 2 if pattern is used : first string is appended for matched types, second to the absence of matches (for types in typeList), or of the same lenght as sets: postfixes to be appended to the type name of all neurons whose name is in the corresponding set

postfix

One of "raw, "to" or "from". Specify if type (and name) columns in table to be modified are postfixed with to and from or nothing

redefinePartners

If table is a neuronBag, should the partners also be retyped?

perl

Should the grep match use perl rules?

Details

pattern, typeList and perl are used if pattern is used. Alternatively sets allow to retype according to an arbitrary number of subtypes

Examples

1
2
3
4
5
6
7
## Not run: 
PFLNames <- getTypesTable(c("PFL1","PFL2","PFL3"))

## Rename only PFL3 according to their strange output pattern
PFLNames3 <- redefineTypeByName(PFLNames,typeList = c("PFL3"),pattern = "(^.*_L(?!.*irreg))|(^.*_R.*irreg)",perl=TRUE,nameModifiers = c("_L*","_R*"))

## End(Not run)

jayaraman-lab/neuprintrExtra documentation built on Dec. 20, 2021, 10 p.m.