2015-07-10 68 views
-1

我想使用從negvalues到的過濾器來過濾出fitted.values.plot中的行。我試過是這樣的:根據矢量從一個文件中過濾行

fitted.values.plot.filter <- fitted.values.plot[!fitted.values.plot$miRNAs_2, 
%in% negvalues,] 

negvalues:

> negvalues 
[1] hsa-mir-135b hsa-mir-9-2 hsa-mir-9-3 hsa-mir-9-1 hsa-mir-139 hsa-mir-3152 hsa-mir-129-2 hsa-mir-129-1 
[9] hsa-mir-584 hsa-mir-195 hsa-mir-378a hsa-mir-30a hsa-mir-497 hsa-mir-183 hsa-mir-182 hsa-mir-378g 
[17] hsa-mir-21  hsa-mir-31  hsa-mir-378i hsa-mir-138-2 hsa-mir-138-1 hsa-mir-4662a hsa-mir-378c hsa-mir-504 
[25] hsa-mir-19a hsa-mir-10b hsa-mir-422a hsa-mir-218-1 hsa-mir-218-2 hsa-mir-7-1 hsa-mir-25  hsa-mir-204 
[33] hsa-mir-145 hsa-mir-7-3 hsa-mir-1224 hsa-mir-503 hsa-mir-26a-2 hsa-mir-26a-1 hsa-mir-7-2 hsa-mir-92a-1 
[41] hsa-mir-3195 hsa-mir-642a hsa-mir-149 hsa-mir-125a hsa-mir-99a hsa-mir-224 hsa-let-7c  hsa-mir-29b-1 
[49] hsa-mir-215 hsa-mir-135a-1 hsa-mir-4532 hsa-mir-3687 hsa-mir-378d-2 hsa-mir-135a-2 
54 Levels: hsa-let-7c hsa-mir-10b hsa-mir-1224 hsa-mir-125a hsa-mir-129-1 hsa-mir-129-2 hsa-mir-135a-1 ... hsa-mir-99a 
> 

fitted.values.plot:

> head(fitted.values.plot) 
       100    106    122    124    126    134 
1 0.689673028877691 2.05061067282612 1.05656799134149 1.75048593733063 0.310608256464213 1.19301227491032 
2 0.689964636197034 2.05147771134477 1.05701472906612 1.75122607720905 0.310739587743298 1.19351670396128 
3 0.689420828637648 2.04986080371093 1.05618162462874 1.74984581809282 0.310494672963684 1.1925760131319 
4 0.819027066280732 2.43522013059115 1.25473629682568 2.0788044504954 0.36886547451107 1.4167718652805 
5 1.71613593527086 5.10260154817646 2.62909265996488 4.35579136120192 0.772896674787318 2.96861142957053 
6 0.581521608151111 1.72904313525816 0.890881753699624 1.47598261016372 0.261900067482724 1.00592945874486 
       141    167    185    192    235    239    243 
1 0.867775250152935 1.78201822975849 4.56767147668584 0.88919230295437 1.20614688357531 2.44091589518612 0.453229695574674 
2 0.868142162593898 1.78277170211024 4.56960277801154 0.889568270946429 1.20665686619711 2.44194796242832 0.453421330002931 
3 0.867457921335906 1.78136657976424 4.56600116656115 0.888867142330624 1.20570581872163 2.44002329891381 0.453063958140798 
4 1.0305338726677 2.11625089232931 5.42437707818155 1.05596787572402 1.43236998141843 2.89873041421608 0.538236776522783 
5 2.15931351259239 4.43425419487975 11.3658862003178 2.21260626495642 3.00129470553158 6.07381078758356 1.1277862623877 
6 0.731694640580416 1.50257015039446 3.85138979111705 0.749753167542404 1.01700435718728 2.05814244909665 0.382156254335941 
       246    26    261    267    270    279 
1 9.29220635550229 0.917975598997362 1.23335634006278 0.799542483070391 0.280114334869145 14.3542483667977 
2 9.29613528308486 0.918363737133027 1.23387782737788 0.799880545355599 0.280232772718505 14.36031762529 
3 9.288808373306 0.917639912872592 1.23290532523112 0.799250105671664 0.280011902412698 14.3489992926246 
4 11.0350386225875 1.09014972354014 1.46468280269592 0.949503470277195 0.332652158783696 17.0465096303023 
5 23.1221007302257 2.28422868109658 3.06900088527496 1.98952768851301 0.697017653185172 35.7181452871246 
6 7.83504437155823 0.774022796630335 1.03994694915621 0.674161828971106 0.23618806544365 12.1032797348103 
       299    301    305    342    35    350    356 
1 0.753129142741628 1.50036484935157 1.4909962305725 2.28269735314694 5.34698835531872 0.755981268961232 1.08750267953744 
2 0.753447580553803 1.50099923311524 1.4916266530999 2.28366252247813 5.34924916714631 0.756300912708466 1.08796249705657 
3 0.752853737814032 1.4998161946133 1.49045100175897 2.28186261437029 5.34503306391212 0.755704821065611 1.08710500060068 
4 0.8943849135495 1.78177102693844 1.77064524409288 2.71083664007729 6.3498614600319 0.897771980278944 1.29147304867556 
5 1.87403585705227 3.73340688438915 3.7100946441283 5.68011041907495 13.3050858563655 1.88113289592788 2.70606845550359 
6 0.635026819803686 1.26508438560826 1.25718491146553 1.92473502680601 4.50849770391938 0.637431688424655 0.916965403304764 
       361    366    367    377    379    388    400 
1 0.211085453506283 0.847222381841847 1.30506524028464 1.83280982013158 2.96187312094598 1.86849492946425 0.927319872035087 
2 0.211174704587117 0.847580604125905 1.30561704753294 1.83358476816657 2.9631254591481 1.86928496586523 0.927711961113149 
3 0.211008263591912 0.846912568815787 1.30458800287924 1.83213959662387 2.96079002057696 1.86781165659436 0.926980768888328 
4 0.250676324114233 1.00612613924672 1.54984131653617 2.1765688771035 3.51739759475841 2.21894703194334 1.10124659439366 
5 0.525250831926215 2.10817113873598 3.24743648503989 4.56064056900063 7.37012567656856 4.64943699269074 2.30748034105363 
6 0.177983982612795 0.714364780585988 1.1004107823492 1.54539683213722 2.49740550712112 1.57548596321423 0.781901742821317 
       402    46    48    55    57    60 
1 0.917217782115268 0.278406628969608 1.12156870821005 0.389984318352341 1.11390669355888 1.7197525593975 
2 0.917605599831052 0.278524344767328 1.12204292951603 0.390149211391357 1.1143776752144 1.72047970459932 
3 0.916882373109646 0.278304820988556 1.12115857197796 0.389841708543656 1.11349935917905 1.71912367876836 
4 1.08924977166189 0.330624158130626 1.33192845051861 0.463129191343587 1.32282935990787 2.04230676635884 
5 2.28234298058451 0.692768312789999 2.79083606787808 0.970410723478138 2.77177042643805 4.27931649256865 
6 0.773383817181369 0.23474815429827 0.94568935066465 0.328828732553183 0.939228858670536 1.45006870225191 
       68    70    73    77    82    93 
1 0.717084627119229 0.958871302874981 0.874149314497608 0.740455373756385 2.48365414652581 0.999934406893559 
2 0.71738782460137 0.959276732518475 0.874518922018322 0.740768452849802 2.48470428434115 1.00035719882496 
3 0.716822402981821 0.95852066197323 0.873829654807118 0.740184603383782 2.48274592169214 0.999568749999806 
4 0.851579942716058 1.13871576421144 1.03810344694697 0.879334071489469 2.94948458778392 1.1874806023427 
5 1.78434511094657 2.38599079746756 2.17517430519642 1.84249930352591 6.18015777501619 2.48816946107968 
6 0.604634642913903 0.808505420264441 0.737069152839075 0.624340494236301 2.09417868019165 0.843129193102739 
       94  miRNAs_1  miRNAs_2 
1 1.35335856597949 hsa-let-7a-5p hsa-let-7a-1 
2 1.35393079259561 hsa-let-7a-5p hsa-let-7a-2 
3 1.35286366862826 hsa-let-7a-5p hsa-let-7a-3 
4 1.60719246586146 hsa-let-7b-5p hsa-let-7b 
5 3.36760634552223 hsa-let-7c-5p hsa-let-7c 
6 1.14113096603789 hsa-let-7d-5p hsa-let-7d 


> str(fitted.values.plot) 
'data.frame': 1369 obs. of 48 variables: 
$ 100  : Factor w/ 1171 levels "0.00208423487317347",..: 677 678 675 768 972 573 693 620 622 735 ... 
$ 106  : Factor w/ 1171 levels "0.00619707324579727",..: 752 753 750 846 1078 597 769 645 647 813 ... 
$ 122  : Factor w/ 1171 levels "0.00319301431435754",..: 678 679 676 772 1000 573 695 620 622 739 ... 
$ 124  : Factor w/ 1171 levels "0.0052900775915819",..: 697 698 695 823 1052 590 714 638 640 758 ... 
$ 126  : Factor w/ 1171 levels "0.00093867750790807",..: 677 678 675 768 954 573 693 620 622 735 ... 
$ 134  : Factor w/ 1171 levels "0.00360535744240779",..: 681 682 679 775 1005 574 698 622 624 742 ... 
$ 141  : Factor w/ 1171 levels "0.00262247088506391",..: 677 678 675 768 997 573 693 620 622 735 ... 
$ 167  : Factor w/ 1171 levels "0.00538537014436763",..: 698 699 696 827 1056 591 715 639 641 759 ... 
$ 185  : Factor w/ 1171 levels "0.0138037878563998",..: 862 863 860 961 279 744 879 803 805 928 ... 
$ 192  : Factor w/ 1171 levels "0.00268719455332448",..: 677 678 675 768 997 573 693 620 622 735 ... 
$ 235  : Factor w/ 1171 levels "0.00364505104833233",..: 681 682 679 775 1015 574 698 622 624 742 ... 
$ 239  : Factor w/ 1171 levels "0.00737659995129747",..: 766 767 764 860 1100 659 783 707 709 827 ... 
$ 243  : Factor w/ 1171 levels "0.00136968838496083",..: 677 678 675 768 957 573 693 620 622 735 ... 
$ 246  : Factor w/ 1171 levels "0.0280816266896476",..: 1127 1128 1125 149 445 1007 1144 1062 1064 114 ... 
$ 26  : Factor w/ 1171 levels "0.00277417946771979",..: 677 678 675 769 998 573 693 620 622 736 ... 
$ 261  : Factor w/ 1171 levels "0.00372727972151037",..: 683 684 681 777 1018 576 700 624 626 744 ... 
$ 267  : Factor w/ 1171 levels "0.00241626721072567",..: 677 678 675 768 977 573 693 620 622 735 ... 
$ 270  : Factor w/ 1171 levels "0.000846522976489484",..: 677 678 675 768 954 573 693 620 622 735 ... 
$ 279  : Factor w/ 1171 levels "0.0433794331104381",..: 305 306 303 398 699 193 321 244 246 363 ... 
$ 299  : Factor w/ 1171 levels "0.00227600320380762",..: 677 678 675 768 973 573 693 620 622 735 ... 
$ 301  : Factor w/ 1171 levels "0.00453419607635083",..: 690 691 688 784 1027 583 707 631 633 751 ... 
$ 305  : Factor w/ 1171 levels "0.00450588352655514",..: 690 691 688 784 1027 583 707 631 633 751 ... 
$ 342  : Factor w/ 1171 levels "0.0068984536571944",..: 759 760 757 853 1088 603 776 700 702 820 ... 
$ 35  : Factor w/ 1171 levels "0.0161589320300708",..: 902 903 900 1000 264 785 919 833 835 963 ... 
$ 350  : Factor w/ 1171 levels "0.00228462250698566",..: 677 678 675 768 973 573 693 620 622 735 ... 
$ 356  : Factor w/ 1171 levels "0.00328650086991218",..: 679 680 677 773 1001 573 696 620 622 740 ... 
$ 361  : Factor w/ 1171 levels "0.000637913395182892",..: 677 678 675 768 954 573 693 620 622 735 ... 
$ 366  : Factor w/ 1171 levels "0.00256035883618851",..: 677 678 675 768 997 573 693 620 622 735 ... 
$ 367  : Factor w/ 1171 levels "0.00394398848682563",..: 685 686 683 779 1021 578 702 626 628 746 ... 
$ 377  : Factor w/ 1171 levels "0.00553886549576888",..: 699 700 697 828 1057 592 716 640 642 795 ... 
$ 379  : Factor w/ 1171 levels "0.00895096515320675",..: 785 786 783 895 1126 678 818 726 728 862 ... 
$ 388  : Factor w/ 1171 levels "0.00564670812004142",..: 699 700 697 831 1059 592 716 640 642 798 ... 
$ 400  : Factor w/ 1171 levels "0.00280241844316787",..: 677 678 675 770 998 573 693 620 622 737 ... 
$ 402  : Factor w/ 1171 levels "0.00277188929787553",..: 677 678 675 769 998 573 693 620 622 736 ... 
$ 46  : Factor w/ 1171 levels "0.000841362182838137",..: 677 678 675 768 954 573 693 620 622 735 ... 
$ 48  : Factor w/ 1171 levels "0.00338945053153015",..: 679 680 677 773 1000 573 696 620 622 740 ... 
$ 55  : Factor w/ 1171 levels "0.00117855691359054",..: 677 678 675 768 954 573 693 620 622 735 ... 
$ 57  : Factor w/ 1171 levels "0.00336629544576333",..: 679 680 677 773 1000 573 696 620 622 740 ... 
$ 60  : Factor w/ 1171 levels "0.00519719940818688",..: 697 698 695 821 1050 590 714 638 640 758 ... 
$ 68  : Factor w/ 1171 levels "0.00216707443132959",..: 677 678 675 768 973 573 693 620 622 735 ... 
$ 70  : Factor w/ 1171 levels "0.00289776883342749",..: 677 678 675 770 998 573 693 620 622 737 ... 
$ 73  : Factor w/ 1171 levels "0.00264173370474041",..: 677 678 675 768 997 573 693 620 622 735 ... 
$ 77  : Factor w/ 1171 levels "0.00223770228411448",..: 677 678 675 768 973 573 693 620 622 735 ... 
$ 82  : Factor w/ 1171 levels "0.00750575761026171",..: 765 766 763 859 1101 658 782 706 708 826 ... 
$ 93  : Factor w/ 1171 levels "0.00302186409279344",..: 677 678 675 771 998 573 694 620 622 738 ... 
$ 94  : Factor w/ 1171 levels "0.00408993392667926",..: 687 688 685 781 1026 580 704 628 630 748 ... 
$ miRNAs_1: Factor w/ 1208 levels "Cal01","Cal02",..: 11 11 11 12 13 14 15 16 16 17 ... 
$ miRNAs_2: Factor w/ 1230 levels "hsa-let-7a-1",..: 1 2 3 4 5 6 7 8 9 10 ... 
+0

應該安裝' .values.plot [!fitted.values.plot $ miRNAs_2%in%negvalues],如果您正在獲取錯誤。我的意思是省略','。 – user227710

+0

問題是我得到太多比賽。它似乎沒有過濾正確 – BioMan

+2

在這種情況下,請提供僅有一些列和預期輸出的樣本數據。這樣,我們可以重現您的錯誤。 – user227710

回答

1

它的工作對我來說:

fitted.values.plot[fitted.values.plot$miRNAs_2 %in% negvalues,] 
#  X94  miRNAs_1 miRNAs_2 
#5 3.367606 hsa-let-7c-5p hsa-let-7c 
+0

任何想法爲什麼它不爲我工作? – BioMan

+0

你的函數中有一個額外的逗號。可能就是這樣。 –

+0

'fits.values.plot [!fitted.values.plot $ miRNAs_2, %in%negvalues]'爲什麼'mirNAs_2'後面有逗號? –

相關問題