π¦
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#use chr22 as an example | |
#how many entries on the negative strand of chr22? | |
table(bam_df$rname == 'chr22' & bam_df$flag == 16) | |
# FALSE TRUE | |
#3875997 24413 | |
#function for checking negative strand | |
check_neg <- function(x){ | |
if (intToBits(x)[5] == 1){ | |
return(T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install if necessary | |
install.packages('gtools') | |
#load library | |
library(gtools) | |
#urn with 3 balls | |
x <- c('red', 'blue', 'black') | |
#pick 2 balls from the urn with replacement | |
#get all permutations | |
permutations(n=3,r=2,v=x,repeats.allowed=T) | |
# [,1] [,2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install if necessary | |
source("http://bioconductor.org/biocLite.R") | |
biocLite("Rsamtools") | |
#load library | |
library(Rsamtools) | |
#read in entire BAM file | |
bam <- scanBam("wgEncodeRikenCageHchCellPapAlnRep1.bam") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env perl | |
use strict; | |
use warnings; | |
print "My very first Gist on GitHub!\n"; | |
exit(0); | |
__END__ |
NewerOlder