Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"library(SGSeq)\n",
"rm(list = ls())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sample_name <- c(\"day_0.Rep1\",\"day_3.Rep1\",\"day_5.Rep1\")\n",
"file_bam <- c(\"day_0.Rep1.genome.bam\",\"day_3.Rep1.genome.bam\",\"day_5.Rep1.genome.bam\")\n",
"\n",
"si <- data.frame(sample_name,file_bam)\n",
"colnames(si) <- c(\"sample_name\",\"file_bam\")\n",
"\n",
"path <- \"/project/Neurodifferentiation_System/NanoporeResults/IGV\"\n",
"si$file_bam <- file.path(path,si$file_bam)\n",
"\n",
"si\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"si$sample_name <- as.character(si$sample_name)\n",
"si$file_bam <- as.character(si$file_bam)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bi <- getBamInfo(si)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"library(TxDb.Hsapiens.UCSC.hg19.knownGene)\n",
"txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene\n",
"seqlevelsStyle(txdb) <- \"UCSC\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"chr <- 1:22\n",
"chr <- as.character(chr)\n",
"chr <- c(chr, \"X\",\"Y\")\n",
"\n",
"seqlevels_in_bam <- seqlevels(BamFile(bi$file_bam[1]))\n",
"\n",
"#sgfdb2 <- keepSeqlevels(sgfdb, seqlevels_in_bam)\n",
"\n",
"#txdb <- keepSeqlevels(txdb, chr)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"txf_ucsc <- convertToTxFeatures(txdb)\n",
"head(txf_ucsc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#type(txf_ucsc)\n",
"#head(txName(txf_ucsc))\n",
"#head(geneName(txf_ucsc))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"sgf_ucsc <- convertToSGFeatures(txf_ucsc)\n",
"head(sgf_ucsc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sgfc_ucsc <- analyzeFeatures(bi, features = txf_ucsc)\n",
"sgfc_ucsc"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"colData(sgfc_ucsc)\n",
"rowRanges(sgfc_ucsc)\n",
"head(counts(sgfc_ucsc))\n",
"head(FPKM(sgfc_ucsc))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df <- plotFeatures(sgfc_ucsc, geneID = 1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sgfc_pred <- analyzeFeatures(si, which = gr)\n",
"head(rowRanges(sgfc_pred))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sgfc_pred <- annotate(sgfc_pred, txf_ucsc)\n",
"head(rowRanges(sgfc_pred))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"seqlevels_in_bam"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "R",
"language": "R",
"name": "ir"
},
"language_info": {
"codemirror_mode": "r",
"file_extension": ".r",
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}