Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
lakigigar committed Jan 18, 2020
1 parent 282e044 commit 193a973
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions Citations_Analysis_of_Letter_Signatures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"colab_type": "text"
},
"source": [
"This notebook demonstrates how to install and use sleuth for a differential analysis of RNA-seq data\n"
"This notebook reproduces figures and results from the blog post \n"
]
},
{
Expand All @@ -57,7 +57,7 @@
"source": [
"system(\"date\", intern=TRUE)"
],
"execution_count": 3,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand All @@ -82,11 +82,11 @@
"metadata": {
"id": "xvF_iyqbHh2z",
"colab_type": "code",
"outputId": "dbd31ddf-d237-444d-e3ce-08d8680eebfd",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 425
},
"outputId": "dbd31ddf-d237-444d-e3ce-08d8680eebfd"
}
},
"source": [
"\n",
Expand All @@ -95,7 +95,7 @@
"library(ggplot2)\n",
"library(MASS)"
],
"execution_count": 4,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -133,11 +133,11 @@
"metadata": {
"id": "N70RrBTbH59y",
"colab_type": "code",
"outputId": "fa5fad37-eb85-4d4e-9c65-9edf21ef97e8",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "fa5fad37-eb85-4d4e-9c65-9edf21ef97e8"
}
},
"source": [
"system(\"wget https://raw.githubusercontent.com/joshp112358/Notices/master/withAMS.csv\")\n",
Expand All @@ -159,7 +159,7 @@
"df$simplefield <- as.factor(df$simplefield)\n",
"summary(df)"
],
"execution_count": 5,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -274,17 +274,17 @@
"metadata": {
"id": "F8AZtcDa2tRM",
"colab_type": "code",
"outputId": "76df97b6-4c54-4e02-9435-fa614463ef44",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 453
},
"outputId": "76df97b6-4c54-4e02-9435-fa614463ef44"
}
},
"source": [
"cor(filter(df,df$citations>0 & df$amscit >0)$citations,filter(df,df$citations & df$amscit>0)$amscit)\n",
"plot(log(filter(df,df$citations>0 & df$amscit >0)$citations),log(filter(df,df$citations & df$amscit>0)$amscit))"
],
"execution_count": 6,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -329,18 +329,18 @@
"metadata": {
"id": "NiET3-yEJZUW",
"colab_type": "code",
"outputId": "2c2393a8-0fa0-456d-8043-d2347c2416c2",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 543
},
"outputId": "2c2393a8-0fa0-456d-8043-d2347c2416c2"
}
},
"source": [
"install.packages(\"naniar\")\n",
"library(naniar)\n",
"vis_miss(df)"
],
"execution_count": 7,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -381,17 +381,17 @@
"metadata": {
"id": "4umWScV3Pmkt",
"colab_type": "code",
"outputId": "b4d58707-8a58-4aca-d46d-d170da3d4b8a",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 453
},
"outputId": "b4d58707-8a58-4aca-d46d-d170da3d4b8a"
}
},
"source": [
"cor(filter(df,df$citations>0 & df$age>-1)$age,filter(df,df$citations>0 & df$age>-1)$citations)\n",
"plot(log(filter(df,df$citations>0)$age),log(filter(df,df$citations>0)$citations))"
],
"execution_count": 8,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -436,11 +436,11 @@
"metadata": {
"id": "BGSVvKEvVTvS",
"colab_type": "code",
"outputId": "bf3bc33a-1640-484a-9686-1d29bb7f29d9",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 83
},
"outputId": "bf3bc33a-1640-484a-9686-1d29bb7f29d9"
}
},
"source": [
"mean(filter(df,gender==\"woman\"&citations>-1&amscit>-1)$amscit)\n",
Expand All @@ -450,7 +450,7 @@
"mean(filter(df,gender==\"man\"&citations>-1&amscit>-1)$amscit)\n",
"mean(filter(df,gender==\"man\"&is.na(df$citations) & amscit>-1)$amscit)\n"
],
"execution_count": 9,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -523,18 +523,18 @@
"metadata": {
"id": "gRFjbXFCYG0R",
"colab_type": "code",
"outputId": "76d49e93-8082-4d8f-f94d-820c709a4095",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 50
},
"outputId": "76d49e93-8082-4d8f-f94d-820c709a4095"
}
},
"source": [
"mean(filter(df,gender==\"woman\" & age>-1)$age)\n",
"mean(filter(df,gender==\"man\" & age>-1)$age)\n",
"\n"
],
"execution_count": 10,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -575,18 +575,18 @@
"metadata": {
"id": "XM-30gkkmUTu",
"colab_type": "code",
"outputId": "d08f06ae-d8b9-4eac-e750-0f2e3c095e1b",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 50
},
"outputId": "d08f06ae-d8b9-4eac-e750-0f2e3c095e1b"
}
},
"source": [
"length(filter(df,gender==\"woman\"& amscit>-1)$amscit)\n",
"length(filter(df,gender==\"woman\")$age)\n",
"\n"
],
"execution_count": 33,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -627,11 +627,11 @@
"metadata": {
"id": "sDZDLTMImKQO",
"colab_type": "code",
"outputId": "975716f9-0d51-4c24-cc4b-04c6671a718a",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 643
},
"outputId": "975716f9-0d51-4c24-cc4b-04c6671a718a"
}
},
"source": [
"plot1 <- ggplot(df, aes(x=age))+\n",
Expand All @@ -652,7 +652,7 @@
"median(filter(df, (lettergroup == \"B and C\"|lettergroup == \"B Only\"|lettergroup == \"A and B\"))$age, na.rm = TRUE)\n",
"median(filter(df, (lettergroup == \"C Only\"|lettergroup == \"C and B\"))$age, na.rm = TRUE)"
],
"execution_count": 31,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -789,11 +789,11 @@
"metadata": {
"id": "7uzfQvOnnYAE",
"colab_type": "code",
"outputId": "d66b8360-15ba-4f58-f1ed-5ce0f28c9012",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 593
},
"outputId": "d66b8360-15ba-4f58-f1ed-5ce0f28c9012"
}
},
"source": [
"plot4 <- ggplot(df, aes(x=citations))+\n",
Expand All @@ -810,7 +810,7 @@
"mean(filter(df, ((lettergroup == \"B Only\"|lettergroup == \"A and B\"|lettergroup == \"B and C\")&(role==\"professor\")))$citations, na.rm = TRUE)\n",
"mean(filter(df, ((lettergroup == \"C Only\"|lettergroup == \"B and C\")&(role==\"professor\")))$citations, na.rm = TRUE)\n"
],
"execution_count": 44,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -899,17 +899,17 @@
"metadata": {
"id": "6Lfsxxe6rkTq",
"colab_type": "code",
"outputId": "856877f7-daf5-477b-c6fa-4ad677956a19",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 436
},
"outputId": "856877f7-daf5-477b-c6fa-4ad677956a19"
}
},
"source": [
"plot(filter(df,(lettergroup == \"C Only\"|lettergroup == \"B and C\")&(role==\"professor\"))$age,filter(df,(lettergroup == \"C Only\"|lettergroup == \"B and C\")&(role==\"professor\"))$citations)\n",
"abline(v=36,col=\"red\")"
],
"execution_count": 60,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -938,11 +938,11 @@
"metadata": {
"id": "pwkZRpVNoFb1",
"colab_type": "code",
"outputId": "bcdd935e-f7c1-49fe-dfee-1076a7a48188",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 593
},
"outputId": "bcdd935e-f7c1-49fe-dfee-1076a7a48188"
}
},
"source": [
"plot4 <- ggplot(df, aes(x=citations))+\n",
Expand All @@ -960,7 +960,7 @@
"mean(filter(df, ((lettergroup == \"C Only\"|lettergroup == \"B and C\")&(role==\"professor\")&(age < 36)))$citations, na.rm = TRUE)\n",
"\n"
],
"execution_count": 45,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down

0 comments on commit 193a973

Please sign in to comment.