Mercurial > repos > davidvanzessen > argalaxy_tools
comparison report_clonality/RScript.r @ 52:371c568408e9 draft
Uploaded
| author | davidvanzessen |
|---|---|
| date | Fri, 29 Jan 2016 05:29:52 -0500 |
| parents | 2a79f9adf89b |
| children | 379856bef228 |
comparison
equal
deleted
inserted
replaced
| 51:d3d4823c101a | 52:371c568408e9 |
|---|---|
| 454 cartegianProductVD = expand.grid(Top.V.Gene = Vchain$v.name, Top.D.Gene = Dchain$v.name, Sample = unique(inputdata$Sample)) | 454 cartegianProductVD = expand.grid(Top.V.Gene = Vchain$v.name, Top.D.Gene = Dchain$v.name, Sample = unique(inputdata$Sample)) |
| 455 | 455 |
| 456 completeVD = merge(VandDCount, cartegianProductVD, all.y=TRUE) | 456 completeVD = merge(VandDCount, cartegianProductVD, all.y=TRUE) |
| 457 completeVD = merge(completeVD, revVchain, by.x="Top.V.Gene", by.y="v.name", all.x=TRUE) | 457 completeVD = merge(completeVD, revVchain, by.x="Top.V.Gene", by.y="v.name", all.x=TRUE) |
| 458 completeVD = merge(completeVD, Dchain, by.x="Top.D.Gene", by.y="v.name", all.x=TRUE) | 458 completeVD = merge(completeVD, Dchain, by.x="Top.D.Gene", by.y="v.name", all.x=TRUE) |
| 459 | |
| 460 if(any(fltr, na.rm=T)){ | |
| 461 completeVD[fltr,"relLength"] = 1 | |
| 462 } | |
| 463 | |
| 459 VDList = split(completeVD, f=completeVD[,"Sample"]) | 464 VDList = split(completeVD, f=completeVD[,"Sample"]) |
| 460 lapply(VDList, FUN=plotVD) | 465 lapply(VDList, FUN=plotVD) |
| 461 } | 466 } |
| 462 | 467 |
| 463 print("Report Clonality - Heatmaps VJ") | 468 print("Report Clonality - Heatmaps VJ") |
| 491 cartegianProductVJ = expand.grid(Top.V.Gene = Vchain$v.name, Top.J.Gene = Jchain$v.name, Sample = unique(inputdata$Sample)) | 496 cartegianProductVJ = expand.grid(Top.V.Gene = Vchain$v.name, Top.J.Gene = Jchain$v.name, Sample = unique(inputdata$Sample)) |
| 492 | 497 |
| 493 completeVJ = merge(VandJCount, cartegianProductVJ, all.y=TRUE) | 498 completeVJ = merge(VandJCount, cartegianProductVJ, all.y=TRUE) |
| 494 completeVJ = merge(completeVJ, revVchain, by.x="Top.V.Gene", by.y="v.name", all.x=TRUE) | 499 completeVJ = merge(completeVJ, revVchain, by.x="Top.V.Gene", by.y="v.name", all.x=TRUE) |
| 495 completeVJ = merge(completeVJ, Jchain, by.x="Top.J.Gene", by.y="v.name", all.x=TRUE) | 500 completeVJ = merge(completeVJ, Jchain, by.x="Top.J.Gene", by.y="v.name", all.x=TRUE) |
| 501 | |
| 502 fltr = is.nan(completeVJ$relLength) | |
| 503 if(any(fltr, na.rm=T)){ | |
| 504 completeVJ[fltr,"relLength"] = 1 | |
| 505 } | |
| 506 | |
| 496 VJList = split(completeVJ, f=completeVJ[,"Sample"]) | 507 VJList = split(completeVJ, f=completeVJ[,"Sample"]) |
| 497 lapply(VJList, FUN=plotVJ) | 508 lapply(VJList, FUN=plotVJ) |
| 498 | 509 |
| 499 | 510 |
| 500 | 511 |
| 529 cartegianProductDJ = expand.grid(Top.D.Gene = Dchain$v.name, Top.J.Gene = Jchain$v.name, Sample = unique(inputdata$Sample)) | 540 cartegianProductDJ = expand.grid(Top.D.Gene = Dchain$v.name, Top.J.Gene = Jchain$v.name, Sample = unique(inputdata$Sample)) |
| 530 | 541 |
| 531 completeDJ = merge(DandJCount, cartegianProductDJ, all.y=TRUE) | 542 completeDJ = merge(DandJCount, cartegianProductDJ, all.y=TRUE) |
| 532 completeDJ = merge(completeDJ, revDchain, by.x="Top.D.Gene", by.y="v.name", all.x=TRUE) | 543 completeDJ = merge(completeDJ, revDchain, by.x="Top.D.Gene", by.y="v.name", all.x=TRUE) |
| 533 completeDJ = merge(completeDJ, Jchain, by.x="Top.J.Gene", by.y="v.name", all.x=TRUE) | 544 completeDJ = merge(completeDJ, Jchain, by.x="Top.J.Gene", by.y="v.name", all.x=TRUE) |
| 545 | |
| 546 fltr = is.nan(completeDJ$relLength) | |
| 547 if(any(fltr, na.rm=T)){ | |
| 548 completeDJ[fltr,"relLength"] = 1 | |
| 549 } | |
| 550 | |
| 534 DJList = split(completeDJ, f=completeDJ[,"Sample"]) | 551 DJList = split(completeDJ, f=completeDJ[,"Sample"]) |
| 535 lapply(DJList, FUN=plotDJ) | 552 lapply(DJList, FUN=plotDJ) |
| 536 } | 553 } |
| 537 | 554 |
| 538 | 555 |
