Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayhesselberth/99cc360cdb95e2e6f943134dcfe960be to your computer and use it in GitHub Desktop.
Save jayhesselberth/99cc360cdb95e2e6f943134dcfe960be to your computer and use it in GitHub Desktop.
``` r
library(tidyverse)
# How abundant is Xrn1?
tab <- readr::read_tsv("https://yeastgfp.yeastgenome.org/allOrfData.txt")
#> Warning: Missing column names filled in: 'X33' [33]
#> Parsed with column specification:
#> cols(
#> .default = col_logical(),
#> orfid = col_integer(),
#> yORF = col_character(),
#> `gene name` = col_character(),
#> `GFP tagged?` = col_character(),
#> `GFP visualized?` = col_character(),
#> `TAP visualized?` = col_character(),
#> abundance = col_character(),
#> error = col_double(),
#> `localization summary` = col_character(),
#> X33 = col_character()
#> )
#> See spec(...) for full column specifications.
#> Warning in rbind(names(probs), probs_f): number of columns of result is not
#> a multiple of vector length (arg 1)
#> Warning: 6234 parsing failures.
#> row # A tibble: 5 x 5 col row col expected actual file expected <int> <chr> <chr> <chr> <chr> actual 1 1 <NA> 33 columns 34 columns 'https://yeastgfp.yeastgenome.org/all… file 2 2 <NA> 33 columns 34 columns 'https://yeastgfp.yeastgenome.org/all… row 3 3 <NA> 33 columns 34 columns 'https://yeastgfp.yeastgenome.org/all… col 4 4 <NA> 33 columns 34 columns 'https://yeastgfp.yeastgenome.org/all… expected 5 5 <NA> 33 columns 34 columns 'https://yeastgfp.yeastgenome.org/all…
#> ... ................. ... .......................................................................... ........ .......................................................................... ...... .......................................................................... .... .......................................................................... ... .......................................................................... ... .......................................................................... ........ ..........................................................................
#> See problems(...) for more details.
all <- tab %>%
select(yORF, abundance) %>%
mutate(abundance = as.numeric(abundance)) %>%
na.omit()
#> Warning in evalq(as.numeric(abundance), <environment>): NAs introduced by
#> coercion
all
#> # A tibble: 3,868 x 2
#> yORF abundance
#> <chr> <dbl>
#> 1 YAL001C 125
#> 2 YAL002W 736
#> 3 YAL005C 269000
#> 4 YAL007C 26300
#> 5 YAL008W 1920
#> 6 YAL009W 861
#> 7 YAL010C 768
#> 8 YAL011W 1380
#> 9 YAL012W 38300
#> 10 YAL016W 16900
#> # ... with 3,858 more rows
# Histogram of protein abundances in yeast
ggplot(all, aes(x = log10(abundance))) + geom_histogram()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
```
![](https://i.imgur.com/PDAoo1q.png)
``` r
# Xrn1 is YGL173C
all %>%
arrange(desc(abundance)) %>%
mutate(rank = row_number()) %>%
filter(yORF == "YGL173C")
#> # A tibble: 1 x 3
#> yORF abundance rank
#> <chr> <dbl> <int>
#> 1 YGL173C 11700 552
```
Created on 2018-07-14 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment