Closed rfarouni closed 8 years ago
HI Rick,
The following could should keep ‘region’ last and not break the downstream code, right?
distancetoTSS <- distanceToNearest(grange, TSS)
mcols(grange)$gene_name <- mcols(TSS[subjectHits(distancetoTSS), ])$gene_name
mcols(grange)$region <- ifelse(mcols(distancetoTSS)$distance <= distancefromTSS, "TSS-proximal", "TSS-distal") return(grange) }
Ewy
Not really. This is what you get instead
$consPeaksAnnotated
GRanges object with 195887 ranges and 4 metadata columns:
seqnames ranges strand | meta.region meta.A549 meta.SAEC meta.NA
<Rle> <IRanges> <Rle> | <character> <character> <character> <character>
[1] chr1 [ 10146, 10349] * | DDX11L1 TSS-proximal A549 <NA>
[2] chr1 [237719, 237910] * | AP006222.2 TSS-proximal A549 <NA>
[3] chr1 [521551, 521614] * | RP5-857K21.2 TSS-proximal <NA> <NA>
[4] chr1 [564454, 570272] * | RP5-857K21.11 TSS-proximal A549 <NA>
[5] chr1 [713897, 715323] * | RP11-206L10.9 TSS-proximal A549 <NA>
... ... ... ... . ... ... ... ...
[195883] chrY [59003875, 59006774] * | CTBP2P1 TSS-distal A549 <NA>
[195884] chrY [59011978, 59020934] * | CTBP2P1 TSS-distal A549 <NA>
[195885] chrY [59024187, 59024559] * | CTBP2P1 TSS-distal A549 <NA>
[195886] chrY [59027624, 59027997] * | CTBP2P1 TSS-distal A549 <NA>
[195887] chrY [59029576, 59030134] * | CTBP2P1 TSS-distal <NA> <NA>
OK. I won’t be able to work on this for another couple of days. Is there a separate branch to work on this? Perhaps keep this as the last issue so the others can move along? Ewy
From: Rick Farouni notifications@github.com<mailto:notifications@github.com> Reply-To: Mathelab/ALTRE reply@reply.github.com<mailto:reply@reply.github.com> Date: Sunday, October 9, 2016 at 10:52 PM To: Mathelab/ALTRE ALTRE@noreply.github.com<mailto:ALTRE@noreply.github.com> Cc: Ewy Mathe Ewy.Mathe@osumc.edu<mailto:Ewy.Mathe@osumc.edu>, Assign assign@noreply.github.com<mailto:assign@noreply.github.com> Subject: Re: [Mathelab/ALTRE] Adding gene names (#46)
Not really. This is what you get instead
$consPeaksAnnotated GRanges object with 195887 ranges and 4 metadata columns: seqnames ranges strand | meta.region meta.A549 meta.SAEC meta.NA
I've mostly fixed this. Where should I push it when I am done? Make a new branch?
Thank you. Yes, safest to make a branch. Ewy
From: baskineliz notifications@github.com<mailto:notifications@github.com> Reply-To: Mathelab/ALTRE reply@reply.github.com<mailto:reply@reply.github.com> Date: Monday, October 10, 2016 at 2:37 PM To: Mathelab/ALTRE ALTRE@noreply.github.com<mailto:ALTRE@noreply.github.com> Cc: Ewy Mathe Ewy.Mathe@osumc.edu<mailto:Ewy.Mathe@osumc.edu>, Assign assign@noreply.github.com<mailto:assign@noreply.github.com> Subject: Re: [Mathelab/ALTRE] Adding gene names (#46)
I've mostly fixed this. Where should I push it when I am done? Make a new branch?
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3Agithub.com_Mathelab_ALTRE_issues_46-23issuecomment-2D252704057&d=CwMCaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=pkWo6jJNl41ic_xQrlnWj5gfoyxaNa9d19I7T8gGjVo&s=dck6no5Wq1f7DMz72kybY5CRw8PtcgSvWiXQzIRuGe0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3Agithub.com_notifications_unsubscribe-2Dauth_AOpx3Sq9-2Dlk6PD38BN2fZNrC0cC7FRsYks5qyoX7gaJpZM4KRw0T&d=CwMCaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=pkWo6jJNl41ic_xQrlnWj5gfoyxaNa9d19I7T8gGjVo&s=saFMY2_eBoXwJtNd_ecEnD5LOp3DzetOuSepOLz7rUM&e=.
Ok, thanks. I made a new branch called "add genes" and pushed the changes. It's fixed and I tested all the downstream functions and plots to make sure everything worked in both R and Rshiny. The major thing that needed fixing downstream was that the columns with the cell lines were now off by one since they are selected by number.
OK good. Are they still selected by number? Best to select by name… Ewy
From: baskineliz notifications@github.com<mailto:notifications@github.com> Reply-To: Mathelab/ALTRE reply@reply.github.com<mailto:reply@reply.github.com> Date: Monday, October 10, 2016 at 3:27 PM To: Mathelab/ALTRE ALTRE@noreply.github.com<mailto:ALTRE@noreply.github.com> Cc: Ewy Mathe Ewy.Mathe@osumc.edu<mailto:Ewy.Mathe@osumc.edu>, Assign assign@noreply.github.com<mailto:assign@noreply.github.com> Subject: Re: [Mathelab/ALTRE] Adding gene names (#46)
Ok, thanks. I made a new branch called "add genes" and pushed the changes. It's fixed and I tested all the downstream functions and plots to make sure everything worked in both R and Rshiny. The major thing that needed fixing downstream was that the columns with the cell lines were now off by one since they are selected by number.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Mathelab_ALTRE_issues_46-23issuecomment-2D252722857&d=CwMFaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=OSc5DQdVpBIdo2Mma16mQRXIJtn384OYWz68Ilc1OzI&s=nzF2I5i6Wg9ByzndQMuIuw9-MqBCdy13LJ6ElxU08zM&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOpx3V-2DnhLZ5-2DzzIafvn7XajIDuIcmGwks5qypGegaJpZM4KRw0T&d=CwMFaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=OSc5DQdVpBIdo2Mma16mQRXIJtn384OYWz68Ilc1OzI&s=v59O7N-5-fiJe4t2eSamqt5nhIqDxAXRBRw7rj893U4&e=.
Right now the names of the columns are "A549" and "SAEC" so you cannot select by name since it is specific to the cell-type you are studying. I could change it to "Sample 1" and "Sample 2" though.
There should be a way to grab those names automatically….you know what the reference is, that’s now included in the output data frame, no? Ewy
From: baskineliz notifications@github.com<mailto:notifications@github.com> Reply-To: Mathelab/ALTRE reply@reply.github.com<mailto:reply@reply.github.com> Date: Monday, October 10, 2016 at 3:35 PM To: Mathelab/ALTRE ALTRE@noreply.github.com<mailto:ALTRE@noreply.github.com> Cc: Ewy Mathe Ewy.Mathe@osumc.edu<mailto:Ewy.Mathe@osumc.edu>, Assign assign@noreply.github.com<mailto:assign@noreply.github.com> Subject: Re: [Mathelab/ALTRE] Adding gene names (#46)
Right now the names of the columns are "A549" and "SAEC" so you cannot select by name since it is specific to the cell-type you are studying. I could change it to "Sample 1" and "Sample 2" though.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Mathelab_ALTRE_issues_46-23issuecomment-2D252725657&d=CwMCaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=pUGnnBZzz4bihmbU2HQvt6on1sZPk5y5mZ2ZNlvR0B0&s=9GwoAdhh7wHb5e1jHwPZYqGVTsIBENgbKsTso6OIlxU&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOpx3YCBY4qvQkl2ZHnUdHlAlv6pTvZYks5qypOWgaJpZM4KRw0T&d=CwMCaQ&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=kwZD24MMCbG_sisYwGVpukmuRHYOGbXk10phc-LvGu4&m=pUGnnBZzz4bihmbU2HQvt6on1sZPk5y5mZ2ZNlvR0B0&s=6QKak4wzwlXLOXsBvAFzJWXbZEglLqE2ODJa4mfmeac&e=.
To add the gene names, I modified your function from
to
so the output is exactly the same but with an additional column (i.e. gene_name)
The problem now is that the rest of the code needs to be modified since downstream functions assume that region is the last column. As a result, you get something like this