R/numericArms.r

Defines functions numericArms

####################################################################
## Author: Gro Nilsen, Knut Liestřl and Ole Christian Lingjćrde.
## Maintainer: Gro Nilsen <gronilse@ifi.uio.no>
## License: Artistic 2.0
## Part of the copynumber package
## Reference: Nilsen and Liestřl et al. (2012), BMC Genomics
####################################################################

#Function that converts character arms to numeric


##Input:
### chrom : vector with chromosome numbers corresponding to each character arm
### char.arms : vector containing charcter arms; dentoed p or q

## Output:
### arms : vector with numeric arms calculated as chrom*2 - 1 or chrom*2

##Required by:
### adjustPos
### adjustSeg
### multipcf
### fastPcf
### pcf
### winsorize
### aspcf

##Requires:
###  none


numericArms <- function(chrom,char.arms){
  p.arm <- which(char.arms=="p")
  q.arm <- which(char.arms=="q")
  arms <- rep(NA,length(char.arms))
  arms[p.arm] <- chrom[p.arm]*2-1
  arms[q.arm] <- chrom[q.arm]*2
  
  return(arms)
}

Try the copynumber package in your browser

Any scripts or data that you put into this service are public.

copynumber documentation built on Nov. 8, 2020, 6:10 p.m.