sadII_lab5_ucsc_data

2303 days ago by macieksk

# Niestety na sage.mimuw.edu.pl sa problemy z zainstalowaniem pakietu "rtracklayer" # Ponizej przykladowa sesja z uzyciem tego pakietu, natomiast dane wczytane sa z pliku. 
       
#library(rtracklayer) #session <- browserSession("UCSC") 
       
#tnames<-trackNames(session) #length(tnames) #head(tnames,20) 
       
[1] 143
     Base Position    Chromosome Band        STS Markers        FISH
Clones        Recomb Rate 
           "ruler"         "cytoBand"           "stsMap"      
"fishClones"       "recombRate" 
       Map Contigs           Assembly    GRC Map Contigs            
Gap      BAC End Pairs 
          "ctgPos"             "gold"          "ctgPos2"            
"gap"      "bacEndPairs" 
  Fosmid End Pairs         GC Percent  GRC Patch Release         
Hg18 Diff       Hi Seq Depth 
     "fosEndPairs"          "gc5Base"  "altSeqComposite"  
"hg19ContigDiff"       "hiSeqDepth" 
     NCBI Incident        Short Match      Restr Enzymes        
Wiki Track          BU ORChID 
  "ncbiIncidentDb"       "oligoMatch"          "cutters"       
"wikiTrack" "wgEncodeBuOrchid" 
#tnames[grep("miRNA",names(tnames))] 
       
     sno/miRNA TS miRNA sites 
       "wgRna"  "targetScanS" 
%time #query <- ucscTableQuery(session, "wgRna") #tableNames(query) 
       
[1] "wgRna"
CPU time: 0.00 s,  Wall time: 1.24 s
#tableName(query)<-"wgRna" #mirna <- getTable(query) 
       
[1] "wgRna"
# Wczytywanie tabeli miRNA zapisanej wczesniej w innej sesji load("data/miRNA.Rdata") ls() 
       
[1] "mirna"  "st"     "tnames"
dim(mirna) 
       
[1] 1341   10
head(mirna) 
       
  bin chrom chromStart chromEnd           name score strand
thickStart thickEnd  type
1 585  chr1      30365    30503 hsa-mir-1302-2     0      +         
0        0 miRNA
2 593  chr1    1102483  1102578   hsa-mir-200b     0      +         
0        0 miRNA
3 593  chr1    1103242  1103332   hsa-mir-200a     0      +         
0        0 miRNA
4 593  chr1    1104384  1104467    hsa-mir-429     0      +         
0        0 miRNA
5 608  chr1    3044538  3044599   hsa-mir-4251     0      +         
0        0 miRNA
6 611  chr1    3477258  3477354   hsa-mir-551a     0      -         
0        0 miRNA
summary(mirna) 
       
      bin           chrom       chromStart           chromEnd       
name          score  
 Min.   : 110   chr14  :118   Min.   :    30143   Min.   :    30281 
14q(0)  :   1   Min.   :0  
 1st Qu.: 805   chr1   :115   1st Qu.: 28906892   1st Qu.: 28907024 
14q(I-1):   1   1st Qu.:0  
 Median :1062   chr15  :115   Median : 62622763   Median : 62622838 
14q(I-2):   1   Median :0  
 Mean   :1175   chr19  :105   Mean   : 77498437   Mean   : 77498529 
14q(I-3):   1   Mean   :0  
 3rd Qu.:1425   chrX   :101   3rd Qu.:110141514   3rd Qu.:110141589 
14q(I-4):   1   3rd Qu.:0  
 Max.   :2485   chr17  : 76   Max.   :249120575   Max.   :249120642 
14q(I-5):   1   Max.   :0  
                (Other):711                                         
(Other) :1335              
 strand    thickStart    thickEnd      type    
 -:610   Min.   :0    Min.   :0   CDBox  :269  
 +:731   1st Qu.:0    1st Qu.:0   HAcaBox:112  
         Median :0    Median :0   miRNA  :939  
         Mean   :0    Mean   :0   scaRna : 21  
         3rd Qu.:0    3rd Qu.:0                
         Max.   :0    Max.   :0                
                                               
library(lattice) histogram(~(chromEnd-chromStart)|type,data=mirna,breaks=20) dev.off() 
       
histogram(~(chromEnd-chromStart)|type,data=mirna,breaks=20) 
dev.off()
mirna$width<-with(mirna,chromEnd-chromStart) 
       
histogram(~width|type,data=subset(mirna,type=="miRNA"),breaks=50) dev.off() 
       
null device 
          1 
png(width=800,height=1000) histogram(~width|chrom,data=subset(mirna,type=="miRNA"),breaks=20) dev.off() 
       
null device 
          1 
histogram(~width|strand,data=subset(mirna,type=="miRNA"),breaks=20) dev.off() 
       
null device 
          1 
## Jaki to rozklad? Wykorzystujac wiedze z wykladu postaraj sie dopasowac najlepszy rozklad. 
       
 
       
# Ilosc miRNA na chromosomach mirna.chr.counts<-sort(table(subset(mirna,type=="miRNA")$chrom)) mirna.chr.counts plot(mirna.chr.counts,type="b") dev.off() 
       
chr21 chr18 chr13 chr22  chr6 chr16 chr20 chr12 chr15  chr4 chr10 
chr9  chr5  chr8  chr7 chr11 
   10    14    21    21    23    28    30    32    33    34    36   
37    39    39    40    41 
 chr3 chr17  chr2 chr14  chr1  chrX chr19 
   44    45    48    69    75    89    91 

null device 
          1 
# Pytanie: czy ilosc miRNA zalezy tylko od wielkosci chromosomu? # Czy jakis chromosom jest wyjatkowy pod tym wzgledem? # Wielkosci chromosomu: http://www.biologia.uniba.it/rmc/0-1a_pagina/9-2_Chromosome-size.html