Skip to content

Instantly share code, notes, and snippets.

@stevekm
Last active October 26, 2016 19:40
Show Gist options
  • Save stevekm/dc9687be27c777979786b7a1e0546c29 to your computer and use it in GitHub Desktop.
Save stevekm/dc9687be27c777979786b7a1e0546c29 to your computer and use it in GitHub Desktop.
quickly print out chr chromosome names in a format for easy conversion to R character vector
$ cat data/depth13Genome.depth.summary2.averages_sd.txt | cut -f1
chr1
chr10
chr11
chr12
chr13
chr14
chr15
chr16
chr17
chr18
chr19
chr2
chr20
chr21
chr22
chr3
chr4
chr5
chr6
chr7
chr8
chr9
chrX
chrY
$ cat data/depth13Genome.depth.summary2.averages_sd.txt | cut -f1 | tr '\n' ' ' | sed -e 's/ /", "/g'
chr1", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr2", "chr20", "chr21", "chr22", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chrX", "chrY", "

copy paste

# R
chrom_vec <- c("chr1", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr2", "chr20", "chr21", "chr22", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chrX", "chrY")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment