brennanpincardiff / drawProteins

Creating package to draw proteins from Uniprot API
Other
33 stars 17 forks source link

empty chain #13

Closed fifdick closed 5 years ago

fifdick commented 5 years ago

Hi. Im using drawProteins to plot the domains of various genes. As a test i followed the script of this page: http://rforbiochemists.blogspot.com/2018/02/my-drawproteins-package-has-been.html This worked perfectly well. When trying to draw the chains for the gene MARCH5 (https://www.uniprot.org/uniprot/Q9NX47#family_and_domains) Im proceeding as follows: ` prot_data <- drawProteins::get_features("Q9NX47")

produce data frame

    prot_data <- drawProteins::feature_to_dataframe(prot_data)

    # make protein schematic
    p <- draw_canvas(prot_data)
    p <- draw_chains(p, prot_data)
    p <- draw_domains(p, prot_data)

`

I get a grey chain with no domains (see attached picture). Although when checking prot_data I can see that there are domain features listed:

> prot                                            
                   type                                                                      
featuresTemp      CHAIN                           
featuresTemp.1 TRANSMEM                           
featuresTemp.2 TRANSMEM                         
featuresTemp.3 TRANSMEM                         
featuresTemp.4 TRANSMEM                          
featuresTemp.5  ZN_FING                                                                                
featuresTemp.6  MUTAGEN                                                                                
featuresTemp.7  MUTAGEN                                                                                
featuresTemp.8  MUTAGEN                                                                                

                                                                                  description          
featuresTemp                                                                                           
                                                           E3 ubiquitin-protein ligase MARCH5          
featuresTemp.1                                                                                         
                                                                                      Helical          
featuresTemp.2                                                                                         
                                                                                      Helical          
featuresTemp.3                                                                                         
                                                                                      Helical          
featuresTemp.4                                                                                         
                                                                                      Helical          
featuresTemp.5                                                                                         
                                                                                 RING-CH-type          
featuresTemp.6 Loss of ubiquitin ligase activity, formation of highly interconnected mitochondria, chan
ge in mitochondria morphology that in turns triggers senescence, and perinuclear accumulation          
featuresTemp.7                                         Loss of E3 ubiquitin ligase activity. Formation
of highly interconnected mitochondria and perinuclear accumulation; when associated with S-68
featuresTemp.8                                         Loss of E3 ubiquitin ligase activity. Formation
of highly interconnected mitochondria and perinuclear accumulation; when associated with S-65
               begin end length accession   entryName taxid order            
featuresTemp       1 278    277    Q9NX47 MARH5_HUMAN  9606     1        
featuresTemp.1    99 119     20    Q9NX47 MARH5_HUMAN  9606     1       
featuresTemp.2   139 159     20    Q9NX47 MARH5_HUMAN  9606     1        
featuresTemp.3   209 229     20    Q9NX47 MARH5_HUMAN  9606     1        
featuresTemp.4   238 258     20    Q9NX47 MARH5_HUMAN  9606     1   
featuresTemp.5     6  75     69    Q9NX47 MARH5_HUMAN  9606     1            
featuresTemp.6    43  43      0    Q9NX47 MARH5_HUMAN  9606     1                  
featuresTemp.7    65  65      0    Q9NX47 MARH5_HUMAN  9606     1                                      
featuresTemp.8    68  68      0    Q9NX47 MARH5_HUMAN  9606     1  

Did I do sth wrong or is there simply not more data to be retrieved?

Thanks in advance

march5

`Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.0 LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
[1] LC_CTYPE=en_DK.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_DK.UTF-8 LC_COLLATE=en_DK.UTF-8
[5] LC_MONETARY=en_DK.UTF-8 LC_MESSAGES=en_DK.UTF-8 [7] LC_PAPER=en_DK.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_DK.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats4 parallel stats graphics grDevices utils
[7] datasets methods base

other attached packages:
[1] ggplot2_3.1.0 _drawProteins1.2.0
[3] ensembldb_2.6.3 AnnotationFilter_1.6.0 [5] GenomicFeatures_1.34.1 AnnotationDbi_1.44.0 [7] Biobase_2.41.2 GenomicRanges_1.32.4 [9] GenomeInfoDb_1.18.1 IRanges_2.15.16 [11] S4Vectors_0.19.19 BiocGenerics_0.28.0
[13] nvimcom_0.9-58

loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 lattice_0.20-38
[3] prettyunits_1.0.2 Rsamtools_1.33.3
[5] Biostrings_2.49.0 assertthat_0.2.0
[7] digest_0.6.15 R6_2.3.0
[9] plyr_1.8.4 RSQLite_2.1.1
[11] httr_1.3.1 pillar_1.3.0
[13] zlibbioc_1.28.0 rlang_0.3.0.1
[15] progress_1.2.0 lazyeval_0.2.1
[17] curl_3.2 blob_1.1.1
[19] Matrix_1.2-15 labeling_0.3
[21] BiocParallel_1.15.8 stringr_1.3.1
[23] ProtGenerics_1.14.0 RCurl_1.95-4.11
[25] bit_1.1-14 biomaRt_2.38.0
[27] munsell_0.5.0 DelayedArray_0.7.21
[29] compiler_3.5.1 rtracklayer_1.41.3
[31] pkgconfig_2.0.2 tidyselect_0.2.4
[33] SummarizedExperiment_1.10.1 tibble_1.4.2
[35] GenomeInfoDbData_1.2.0 matrixStats_0.54.0
[37] XML_3.98-1.12 withr_2.1.2
[39] crayon_1.3.4 dplyr_0.7.7 [41] GenomicAlignments_1.16.0 bitops_1.0-6 [43] grid_3.5.1 jsonlite_1.5
[45] gtable_0.2.0 DBI_1.0.0
[47] magrittr_1.5 scales_1.0.0 [49] stringi_1.2.4 XVector_0.21.3 [51] bindrcpp_0.2.2 tools_3.5.1
[53] bit64_0.9-7 glue_1.3.0 [55] purrr_0.2.5 hms_0.4.2
[57] colorspace_1.3-2 memoise_1.1.0
[59] bindr_0.1.1 `

fifdick commented 5 years ago

sorry noticed it was my mistake. I have to add motifs and all other kinds of features to the plot. The reason I didnt before is because I intended to make a function to plot various genes of which i dont know prior to plotting, what kind of features I will be able to retrieve. (something elike draw_allFeatures() would be cool, to draw all features that could have been retrieved)

brennanpincardiff commented 5 years ago

Thanks fifdick, If you add the code:

p <- draw_recept_dom(p, prot_data)

You will get this picture. rplot

Best wishes, Paul

fifdick commented 5 years ago

yes. I found this too, thank you! Is there anything else I can add (I tried all available functions but thats the only thing that comes up)? Although in the features it shows all those things:

                   type                                                                      
featuresTemp      CHAIN                           
featuresTemp.1 TRANSMEM                           
featuresTemp.2 TRANSMEM                         
featuresTemp.3 TRANSMEM                         
featuresTemp.4 TRANSMEM                          
featuresTemp.5  ZN_FING                                                                                
featuresTemp.6  MUTAGEN                                                                                
featuresTemp.7  MUTAGEN                                                                                
featuresTemp.8  MUTAGEN   

are they not plotable?

brennanpincardiff commented 5 years ago

Super question, fifdick.

Because Uniprot seems to come up with an almost limitless variation in names, I haven't added each one individually. I should probably add a plot all function which would help, I think.

In the mean time the following code will draw all the features in stages:

library(drawProteins)

prot_data <- drawProteins::get_features("Q9NX47")
# produce data frame
prot_data <- drawProteins::feature_to_dataframe(prot_data)

# make protein schematic
p <- draw_canvas(prot_data)
p <- draw_chains(p, prot_data)
p <- draw_domains(p, prot_data)
p <- draw_recept_dom(p, prot_data)
p

rplot

# add ZN_FING block in blue
p <- p + ggplot2::geom_rect(data = prot_data[prot_data$type == "ZN_FING",],
  mapping=ggplot2::aes(xmin=begin,
    xmax=end,
    ymin=order-0.2,
    ymax=order+0.2),
  fill = "blue")
p

query_20181204_1

# add ZN_FING label on top of this
p <- p + ggplot2::geom_label(data = prot_data[prot_data$type == "ZN_FING", ],
  ggplot2::aes(x = begin + (end-begin)/2,
    y = order,
    label = description),
  size = 3)
p

query_20181204_2

# add MUTAGEN as red bars on top...
p <- p + ggplot2::geom_rect(data = prot_data[prot_data$type == "MUTAGEN",],
  mapping=ggplot2::aes(xmin=begin,
    xmax=end,
    ymin=order-0.2,
    ymax=order+0.2),
  colour = "red")
p

query_20181204_3

Does this help? Best wishes, Paul

fifdick commented 5 years ago

super. thanks a lot for this help! Might come back with another question in the future. Nice package. Its very intuitive and easy to use.

Am Di., 4. Dez. 2018 um 14:48 Uhr schrieb Paul Brennan < notifications@github.com>:

Super question, fifdick.

Because Uniprot seems to come up with an almost limitless variation in names, I haven't added each one individually. I should probably add a plot all function which would help, I think.

In the mean time the following code will draw all the features in stages:

library(drawProteins) prot_data <- drawProteins::get_features("Q9NX47")# produce data frameprot_data <- drawProteins::feature_to_dataframe(prot_data)

make protein schematicp <- draw_canvas(prot_data)p <- draw_chains(p, prot_data)p <- draw_domains(p, prot_data)p <- draw_recept_dom(p, prot_data)p

[image: rplot] https://user-images.githubusercontent.com/7151469/49446035-2a020f80-f7cb-11e8-844f-79b25d246c1c.png

add ZN_FING block in blue

p <- p + ggplot2::geom_rect(data = prot_data[prot_data$type == "ZN_FING",], mapping=ggplot2::aes(xmin=begin, xmax=end, ymin=order-0.2, ymax=order+0.2), fill = "blue") p

[image: query_20181204_1] https://user-images.githubusercontent.com/7151469/49446004-18b90300-f7cb-11e8-9026-b32caebbd9ab.png

add ZN_FING label on top of this

p <- p + ggplot2::geom_label(data = prot_data[prot_data$type == "ZN_FING", ], ggplot2::aes(x = begin + (end-begin)/2, y = order, label = description), size = 3) p

[image: query_20181204_2] https://user-images.githubusercontent.com/7151469/49446017-1e164d80-f7cb-11e8-8937-ba2a22e2026d.png

add MUTAGEN as red bars on top...

p <- p + ggplot2::geom_rect(data = prot_data[prot_data$type == "MUTAGEN",], mapping=ggplot2::aes(xmin=begin, xmax=end, ymin=order-0.2, ymax=order+0.2), colour = "red") p

[image: query_20181204_3] https://user-images.githubusercontent.com/7151469/49446024-22db0180-f7cb-11e8-8d15-afed6ee02fbd.png

Does this help? Best wishes, Paul

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/brennanpincardiff/drawProteins/issues/13#issuecomment-444105210, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJNKbUgH9z2zz-KQ1txNesUzMHbZcrdks5u1n0ngaJpZM4ZAacU .