Mercurial > repos > davidvanzessen > clonal_sequences_in_paired_samples
comparison RScript.r @ 64:39fff0180d41 draft
Uploaded
author | davidvanzessen |
---|---|
date | Thu, 05 Nov 2015 09:07:03 -0500 |
parents | 39ea37070e90 |
children | 7a63e90cfc3d |
comparison
equal
deleted
inserted
replaced
63:39ea37070e90 | 64:39fff0180d41 |
---|---|
616 CDR3_Sense_Sequence = rows.1[1,"CDR3_Sense_Sequence"], | 616 CDR3_Sense_Sequence = rows.1[1,"CDR3_Sense_Sequence"], |
617 Related_to_leukemia_clone = F, | 617 Related_to_leukemia_clone = F, |
618 Frequency = sum(rows.1$Frequency), | 618 Frequency = sum(rows.1$Frequency), |
619 locus_V = rows.1[1,"locus_V"], | 619 locus_V = rows.1[1,"locus_V"], |
620 locus_J = rows.1[1,"locus_J"], | 620 locus_J = rows.1[1,"locus_J"], |
621 uniqueID = rows.1[1,"uniqueID"], | |
621 normalized_read_count = sum(rows.1$normalized_read_count)) | 622 normalized_read_count = sum(rows.1$normalized_read_count)) |
622 sum.2 = sum.1[NULL,] | 623 sum.2 = sum.1[NULL,] |
623 rows.2 = patient.fuzzy[match.filter.2,] | 624 rows.2 = patient.fuzzy[match.filter.2,] |
624 if(matches.in.2){ | 625 if(matches.in.2){ |
625 sum.2 = data.frame(merge = first.clone.sequence, | 626 sum.2 = data.frame(merge = first.clone.sequence, |
637 CDR3_Sense_Sequence = rows.2[1,"CDR3_Sense_Sequence"], | 638 CDR3_Sense_Sequence = rows.2[1,"CDR3_Sense_Sequence"], |
638 Related_to_leukemia_clone = F, | 639 Related_to_leukemia_clone = F, |
639 Frequency = sum(rows.2$Frequency), | 640 Frequency = sum(rows.2$Frequency), |
640 locus_V = rows.2[1,"locus_V"], | 641 locus_V = rows.2[1,"locus_V"], |
641 locus_J = rows.2[1,"locus_J"], | 642 locus_J = rows.2[1,"locus_J"], |
643 uniqueID = rows.2[1,"uniqueID"], | |
642 normalized_read_count = sum(rows.2$normalized_read_count)) | 644 normalized_read_count = sum(rows.2$normalized_read_count)) |
643 } | 645 } |
644 | 646 |
645 sum.3 = sum.1[NULL,] | 647 sum.3 = sum.1[NULL,] |
646 rows.3 = patient.fuzzy[match.filter.3,] | 648 rows.3 = patient.fuzzy[match.filter.3,] |
660 CDR3_Sense_Sequence = rows.3[1,"CDR3_Sense_Sequence"], | 662 CDR3_Sense_Sequence = rows.3[1,"CDR3_Sense_Sequence"], |
661 Related_to_leukemia_clone = F, | 663 Related_to_leukemia_clone = F, |
662 Frequency = sum(rows.3$Frequency), | 664 Frequency = sum(rows.3$Frequency), |
663 locus_V = rows.3[1,"locus_V"], | 665 locus_V = rows.3[1,"locus_V"], |
664 locus_J = rows.3[1,"locus_J"], | 666 locus_J = rows.3[1,"locus_J"], |
667 uniqueID = rows.3[1,"uniqueID"], | |
665 normalized_read_count = sum(rows.3$normalized_read_count)) | 668 normalized_read_count = sum(rows.3$normalized_read_count)) |
666 } | 669 } |
667 | 670 |
668 if(matches.in.2 & matches.in.3){ | 671 if(matches.in.2 & matches.in.3){ |
669 merge.123 = merge(sum.1, sum.2, by="merge") | 672 merge.123 = merge(sum.1, sum.2, by="merge") |
714 hidden.clone.sequences = c(rows.1[-1,"Clone_Sequence"], rows.3[rows.3$Clone_Sequence != first.clone.sequence,"Clone_Sequence"]) | 717 hidden.clone.sequences = c(rows.1[-1,"Clone_Sequence"], rows.3[rows.3$Clone_Sequence != first.clone.sequence,"Clone_Sequence"]) |
715 merge.list[["second"]] = append(merge.list[["second"]], hidden.clone.sequences) | 718 merge.list[["second"]] = append(merge.list[["second"]], hidden.clone.sequences) |
716 | 719 |
717 } else if(nrow(rows.1) > 1){ | 720 } else if(nrow(rows.1) > 1){ |
718 patient1 = patient1[!(patient1$Clone_Sequence %in% rows.1$Clone_Sequence),] | 721 patient1 = patient1[!(patient1$Clone_Sequence %in% rows.1$Clone_Sequence),] |
719 patient1 = rbind(patient1, sum.1) | 722 print(names(patient1)[names(patient1) %in% sum.1]) |
723 print(names(patient1)[!(names(patient1) %in% sum.1)]) | |
724 print(names(patient1)) | |
725 print(names(sum.1)) | |
726 print(summary(sum.1)) | |
727 print(summary(patient1)) | |
728 print(dim(sum.1)) | |
729 print(dim(patient1)) | |
730 print(head(sum.1[,names(patient1)])) | |
731 patient1 = rbind(patient1, sum.1[,names(patient1)]) | |
720 patient.fuzzy = patient.fuzzy[-match.filter.1,] | 732 patient.fuzzy = patient.fuzzy[-match.filter.1,] |
721 } else { | 733 } else { |
722 patient.fuzzy = patient.fuzzy[-1,] | 734 patient.fuzzy = patient.fuzzy[-1,] |
723 } | 735 } |
724 | 736 |