Skip to content

Instantly share code, notes, and snippets.

View lpantano's full-sized avatar
:octocat:
working

Lorena Pantano lpantano

:octocat:
working
View GitHub Profile
@lpantano
lpantano / run_test.slurm
Last active May 23, 2019 14:58
example of slurm script for pilmbc103
#!/bin/bash
#SBATCH -N 1
#SBATCH -c 1
#SBATCH --mem=200
#SBATCH -J "init"
#SBATCH -e run.e
#SBATCH -o run.o
## SBATCH --mail-type=END,FAIL # this line is commented
## SBATCH [email protected] # this line is commented
@lpantano
lpantano / check_sc_barcode.py
Last active March 18, 2019 18:50
detect barcodes for inDrop file
# Read first X lines of R3 of inDrop fastq files and map to
# sequence barcodes to check if the top N match or not.
import argparse
import os [44/1831]
import gzip
from collections import Counter, defaultdict
from Bio.Seq import Seq
def open_fastq(in_file):
""" open a fastq file, using gzip if it is gzipped
@lpantano
lpantano / cmd
Created October 19, 2018 19:23
reproduce UMI couting
seqcluster collapse -f example.fastq -o test
@lpantano
lpantano / isomirs_combinations
Last active September 27, 2018 19:26
From a sequences generate 4 possible changes
mir = "CCCGGGGGGGGGGGGGGGGGGGGGCCC"
# generate different length +/-3 at both size
lapply(c(1,2,3,4,5,6,7), function(x){
lapply(c(0,1,2,3,4,5,6,7), function(y){
substr(mir, x, nchar(mir)-y)
}) %>% unlist()
}) %>% unlist() -> trim
# add non-tempaltes 3' A or U up to 3
trim_add = expand.grid(trim, c("A","AA", "AAA", "U", "UU", "UUU", "")) %>%
@lpantano
lpantano / lossRand_3p_miraligner.sh
Created September 14, 2018 20:16
lossRand_3p_miraligner
Many sequences are not being capture in the current test_lossRand_3p.mirna. I don't know the reason, but following the instructions in how the authors generated this file I get different results.
```
wget https://github.com/lpantano/seqbuster/raw/miraligner/modules/miraligner/miraligner.jar
wget https://github.com/lpantano/java_seqbuster/raw/master/miraligner/DB/hairpin.fa
wget https://github.com/lpantano/java_seqbuster/raw/master/miraligner/DB/miRNA.str
java -jar miraligner.jar -sub 1 -trim 3 -add 3 -s hsa -i test_lossRand_3p.fastq -db . -o miraligner_lossRand_3p
# this sequences is not detected in the published data, but it is when you run this code.
require(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
library(ChIPseeker)
library(GenomicRanges)
# Hack chipseeker function to add annotaiton
getGenomicAnnoStat <- function(peakAnno) {
if ( class(peakAnno) == "GRanges" )
peakAnno <- as.data.frame(peakAnno)
anno <- peakAnno$annotation
## anno <- sub(" \\(.+", "", anno)
@lpantano
lpantano / Read1.fq
Created February 5, 2015 15:51
difference on code to get working in our reads.
@NS500227_6_H160HBGXX:1:11108:2429:1048 1:N:0:1
AAAACNAAAAATGAGNTTAAATAACTANTNATATGNNTGTTATTTNCTGTNACTANNANANCTG
+
AA7AA#FF.FFF7FF#FFFF7FF<FAA#F#AFAFF##FF<<FA.F#7FF.#.F)<##<#.#FAF
@NS500227_6_H160HBGXX:1:11108:1920:1048 1:N:0:1
GAAGANGGTTCTGAGNATGCTTCTGATNTNGATCTNNGCGGTTTANCCCGNTAACNNCN
+
@lpantano
lpantano / server.R
Last active August 29, 2015 13:58
Plot expression values according to design data.frame using DEGReport object
#https://gist.github.com/jcheng5/4050398
library(ggplot2)
options(shiny.maxRequestSize = -1)
shinyServer(function(input, output,session) {
observe({
if (is.null(input$files)) {
# User has not uploaded a file yet
return(NULL)
}