First, retry with:

sm <- CbsModel(dsN);
fit(sm, verbose=-10);

/Henrik

On Fri, Mar 9, 2012 at 12:39 PM, Yu Song <ys...@oakland.edu> wrote:
> Hi Henrik,
>
> Thanks a lot.
>
> I read http://aroma-project.org/howtos/exportTotalCnRatioSet. So I
> start over with:
>
> 1st prenormalization
> 2nd get copy number ratios
> 3rd CBS
>
> After prenormalization, the result including negative value(see the Mins) :
> -------------------------------------------------------------------------------------------------------------------
>> df1=getFile(ds, 1)
>> summary(df1)
>       1
> Min.   :  -370.4
> 1st Qu.:  1982.1
> Median :  3077.7
> Mean   :  3721.0
> 3rd Qu.:  4692.6
> Max.   :149305.3
>
>>
>> df2=getFile(ds, 2)
>>
>> summary(df2)
>       1
> Min.   :  -286.5
> 1st Qu.:  1952.3
> Median :  2996.4
> Mean   :  3613.9
> 3rd Qu.:  4531.9
> Max.   :212018.2
> -----------------------------------------------------------------------------------------------------------------------
>
>
>
>
>
>
> then I tried to get the copy number ratios. Here we want to get all
> the patients' CN ratio comparing with their average:
>
> --------------------------------------------------------------------------------------------------------------
> ds <- AromaUnitTotalCnBinarySet$byName(dataSet, tags=tags, chipType=chipType);
> dfR <- getAverageFile(ds) # Calculate the reference as the pool of all samples
> dsTCN <- exportTotalCnRatioSet(ds, dfR, logBase=2, verbose=verbose);
>  print(dsTCN)   # Calculate total CN *ratios* (on the log scale)
> relative to the pool.
>
> # Export total CN *ratios* relative to pool together with annotation data
>  dsTxt <- writeDataFrame(dsTCN, columns=c("unitName", "chromosome",
>  "position", "*"));
>  print(dsTxt);
> ---------------------------------------------------------------------------------------------------------------
>
>
>
>
> Then I did CBS:
> ---------------------------------------------------------------------------------------------------------------
> sm <- CbsModel(dsTCN);
> fit(sm, verbose=-10);
> pathname <- writeRegions(sm, verbose=verbose);
> ---------------------------------------------------------------------------------------------------------------
>
>
>
>
>
> Here's the error msg from > fit(sm, verbose=-10);
> ---------------------------------------------------------------------------------------------------------------
>
> In addition: Warning messages:
> 1: In log(M, base = 2) : NaNs produced
> 2: In log(A, base = 2) : NaNs produced
> Array #1 ('1 work 159 SX00808A11') of 20 on chromosome 1...done
> ---------------------------------------------------------------------------------------------------------------
>
>
>
>
>
>
> Also the msg from > pathname <- writeRegions(sm, verbose=verbose)
>
>
> ---------------------------------------------------------------------------------------------------------------
> 20120309 15:30:04|Array #1 ('1 work 159 SX00808A11') of 20...
> 20120309 15:30:04| Extracting regions from all fits...
> 20120309 15:30:04|  Obtaining CN model fits (or fit if missing)...
> Error in list(`writeRegions(sm, verbose = verbose)` = <environment>,
> `writeRegions.CopyNumberSegmentationModel(sm, verbose = verbose)` =
> <environment>,  :
>
> [2012-03-09 15:30:09] Exception: Something is wrong with the
> copy-number ratios of sample '1 work 159
> SX00808A11,ref=.average-signals-median-mad,7083ea84f30d9a8c7209bf9b536a49ed,log2ratio,total'
> relative to reference
> '.average-signals-median-mad,7083ea84f30d9a8c7209bf9b536a49ed' on
> chromosome 1. Too many non-finite values: 145778 (99.4% > 20.0%) out
> of 146626.
>  at throw(Exception(...))
>  at throw.default(sprintf("Something is wrong with the copy-number
> ratios of sample
>  at throw(sprintf("Something is wrong with the copy-number ratios of
> sample '%s' re
>  at getRawCnData.CopyNumberChromosomalModel(this, ceList = ceList,
> refList = rfList
>  at getRawCnData(this, ceList = ceList, refList = rfList, chromosome
> = chromosome,
>  at extractRawCopyNumbers.CopyNumberChromosomalModel(this, array =
> array, chromosom
>  at extractRawCopyNumbers(this, array = array, chromosome = chr,
> maxNAFraction = ma
>  at fit.CopyNumberSegmentationModel(this, ..., .retResults = TRUE,
> verbose = less(v
>  at
> 20120309 15:30:09|  Obtaining CN model fits (or fit if missing)...done
> 20120309 15:30:09| Extracting regions from all fits...done
> 20120309 15:30:09|Array #1 ('1 work 159 SX00808A11') of 20...done
> ---------------------------------------------------------------------------------------------------------------
>
> I guess all these errors are due to the negative result from
> prenormalization. Should I try to replace the negatives with 0?
>
> Thanks.
>
> P.S.   Here's the the negative value list:
> -------------------------------------------------------------------------------------------------------------
> for (i in 1:20) {
>        cat(i)
>        dfi=readDataFrame(getFile(ds, i))
>        dfi.tp<-dfi[,1]
>        cat("patient",i,"\n")
>    cat(which(dfi.tp<0),"\n")
> }
>  1patient 1
> 943513 955712 957779 976865 991266 998658 1036148 1058608 1076250
> 1122492 1134144 1156362 1186658 1188035 1192876 1223844 1234989
> 1253735 1291781 1310027 1322745 1353393 1391839 1412294 1418378
> 1432490 1483941 1493179 1502559 1516478 1516654 1532334 1568001
> 1583761 1620396 1633198 1634578 1635998 1669254 1679534 1694620
> 1705205 1740572 1800610 1803434 1832210 1835156 1846965 1849941
> 1864727 1868660 1868740 1873977 1878603
> 2patient 2
> 945783 959929 964651 969890 970126 1031662 1039584 1051156 1139501
> 1158274 1173770 1185539 1189034 1192316 1249073 1381811 1432469
> 1435714 1439698 1450970 1460766 1520642 1598143 1600133 1638279
> 1694933 1740356 1741652 1745310 1751862 1779387 1779393 1789802
> 1824859 1834359 1838602 1859529 1864727 1868461
> 3patient 3
> 47 582 63730 288832 339454 495430 552449 728862 939308 941333 941729
> 943308 943792 944149 945783 946382 950351 953134 955712 960996 964573
> 965977 969149 971632 974741 980530 988742 989469 990496 992246 1001688
> 1004263 1012175 1018741 1019612 1019622 1024458 1026689 1027998
> 1033377 1038730 1039908 1042916 1053454 1054936 1057431 1058427
> 1059079 1059660 1069025 1070518 1076800 1077480 1079796 1090715
> 1092398 1096097 1096773 1097642 1101546 1107086 1107813 1111666
> 1114334 1120697 1129968 1134144 1145385 1154844 1155347 1158153
> 1166338 1171299 1173827 1174313 1176114 1176928 1177299 1178879
> 1179483 1180636 1182138 1184827 1186658 1187999 1192316 1193525
> 1194183 1194447 1195112 1195918 1201413 1203590 1203954 1208499
> 1210642 1218884 1226114 1244043 1244248 1245683 1249683 1252160
> 1254698 1257559 1257707 1260296 1266565 1266925 1272346 1282266
> 1285231 1286430 1286771 1287909 1293546 1297017 1301043 1307331
> 1309866 1317558 1319324 1326204 1326569 1336586 1337470 1353393
> 1364078 1364538 1364910 1365425 1367806 1374614 1375653 1375917
> 1381665 1387038 1389106 1389323 1390490 1391690 1404912 1407782
> 1409164 1409691 1410083 1410214 1417335 1422381 1430110 1433842
> 1437043 1437381 1438242 1438527 1439587 1440024 1446998 1451686
> 1454641 1459692 1461568 1463331 1474382 1476524 1478829 1482446
> 1482505 1484747 1485776 1486290 1495996 1499598 1504070 1506220
> 1510118 1510294 1512914 1513348 1522901 1523852 1528458 1529153
> 1537412 1538802 1539270 1540678 1540706 1541185 1542543 1545048
> 1545322 1547567 1551950 1555569 1566845 1567671 1568122 1575367
> 1575421 1577163 1581549 1584194 1588392 1588802 1589669 1590867
> 1600690 1604084 1612744 1614874 1622547 1624609 1624816 1631041
> 1632284 1636302 1640874 1644232 1652351 1679534 1680015 1683497
> 1687510 1688324 1692298 1693746 1694951 1700656 1701634 1703223
> 1704687 1709962 1711118 1724067 1725604 1727440 1729768 1733708
> 1737424 1745496 1748245 1750270 1757043 1765030 1767996 1769016
> 1777765 1782816 1786532 1786960 1790638 1791242 1798413 1800355
> 1806272 1811103 1813705 1818041 1819271 1820442 1824842 1825512
> 1826170 1828482 1831458 1831993 1833740 1835348 1836130 1840651
> 1840892 1841304 1841309 1842483 1842484 1844356 1846001 1846172
> 1847271 1847798 1848994 1849257 1851888 1853125 1855132 1857935
> 1858019 1859027 1859144 1859340 1859529 1861652 1861870 1861943
> 1864727 1866648 1868457 1873034 1873118 1873201 1873348 1873641
> 1873783 1873955 1873984 1874268 1875368 1875509 1875699 1876257
> 1876711 1876900 1876934 1877156 1877179 1877250 1877772 1878382
> 1878603 1878677 1879113 1879414 1879987 1880684 1881328 1881375
> 4patient 4
> 936179 938335 939959 941071 943655 947956 950574 950624 951307 953361
> 953771 957421 961182 963682 970210 975230 977711 982162 987245 989375
> 991191 993557 994171 997177 999834 1004934 1008539 1011025 1017415
> 1018990 1019206 1020069 1022240 1024097 1026626 1027161 1035258
> 1038864 1039600 1041273 1043189 1046372 1046516 1050482 1052746
> 1062200 1064325 1065113 1066694 1071155 1075733 1080491 1088897
> 1092143 1095408 1099243 1099357 1102861 1104870 1107323 1109801
> 1114514 1117338 1118559 1119064 1122492 1128480 1128889 1129306
> 1134421 1137119 1138968 1141578 1148024 1152219 1152843 1153350
> 1153863 1155347 1155494 1156217 1158141 1167010 1172305 1172608
> 1176114 1179888 1182077 1184489 1187426 1190307 1190990 1195017
> 1197067 1198872 1199820 1199939 1200882 1202959 1204594 1204934
> 1205788 1205952 1208473 1215420 1220044 1220171 1220725 1223436
> 1227537 1227570 1229619 1230263 1232009 1232148 1235089 1236886
> 1238806 1240211 1244110 1244235 1244598 1247134 1249805 1252656
> 1258804 1259611 1260669 1265633 1270860 1271131 1278021 1280680
> 1282469 1283822 1291526 1297069 1297529 1299095 1299199 1301480
> 1306036 1306452 1314859 1315958 1316153 1318717 1322745 1326854
> 1328565 1329586 1333872 1341403 1349456 1350295 1350903 1355517
> 1356188 1364078 1365640 1365968 1368190 1368822 1375537 1377419
> 1378824 1381269 1384478 1386924 1392775 1396457 1401123 1401534
> 1402605 1408604 1412294 1414409 1416884 1419091 1422257 1429591
> 1430457 1432095 1433254 1434356 1435628 1437668 1438320 1439186
> 1441275 1442004 1442453 1446277 1451337 1457150 1459457 1460857
> 1461309 1464161 1464945 1466815 1467329 1469706 1475356 1476241
> 1479783 1480485 1481615 1486339 1487080 1487316 1490425 1492362
> 1493011 1496313 1499350 1507365 1509362 1510575 1510694 1511720
> 1515467 1522595 1522866 1523747 1526790 1527489 1528054 1532449
> 1532718 1535195 1535707 1542543 1545889 1548134 1554853 1556919
> 1560705 1560767 1564205 1565412 1571426 1573904 1574758 1580214
> 1583761 1583842 1586188 1589599 1590087 1590724 1593664 1595034
> 1595295 1595544 1595555 1596851 1597639 1598607 1600690 1601093
> 1601429 1604291 1606605 1609040 1611150 1614892 1624209 1624363
> 1624816 1625225 1626741 1631406 1634043 1635999 1636301 1636878
> 1639434 1639893 1641155 1642190 1644298 1646620 1648103 1651370
> 1656262 1656703 1657149 1665321 1668105 1676727 1678741 1679276
> 1679518 1685525 1689750 1700163 1703254 1704295 1704834 1704891
> 1708941 1709593 1711106 1711207 1715788 1717560 1724153 1730585
> 1735327 1739958 1741755 1742159 1746977 1750374 1750681 1757752
> 1758966 1761552 1762994 1763679 1768088 1768300 1770899 1771549
> 1773547 1774188 1788761 1789522 1791423 1795640 1798568 1801645
> 1810210 1810715 1812761 1814199 1819271 1819649 1820651 1822677
> 1823921 1826735 1828153 1828698 1828936 1829181 1832578 1834686
> 1834862 1836495 1837127 1837197 1838585 1839932 1841062 1842374
> 1842615 1846353 1846636 1847221 1847638 1847898 1849542 1849656
> 1849941 1852660 1857177 1859529 1861313 1862255 1864727 1865850
> 1866215 1866600 1870134 1870776 1871165 1873755 1875509 1875632
> 1881355
> 5patient 5
> 281 582 583 595 947170 949872 951523 951711 964454 974426 991305
> 1000672 1008057 1011516 1013947 1019622 1030930 1036148 1038163
> 1039584 1050442 1052291 1052412 1054993 1061644 1062103 1068034
> 1093766 1113172 1116227 1116268 1118402 1118554 1126057 1128115
> 1144686 1157034 1160401 1165158 1183346 1186660 1189034 1189045
> 1189047 1190307 1197067 1205812 1209607 1210642 1241616 1242449
> 1244846 1251420 1261553 1272793 1286771 1289346 1306880 1307405
> 1310816 1322746 1322820 1337470 1339556 1357300 1363170 1367088
> 1375653 1385942 1392790 1412294 1440785 1448189 1450446 1464122
> 1468413 1470288 1476235 1478057 1483941 1486898 1489262 1492193
> 1512016 1513254 1518720 1528458 1540334 1543230 1562260 1567465
> 1575667 1579675 1599340 1599970 1600133 1618077 1622926 1627744
> 1635609 1639544 1672425 1678409 1678741 1683683 1690785 1694788
> 1701573 1701605 1705688 1707106 1720813 1737681 1743083 1757247
> 1758894 1762268 1773670 1776137 1790717 1791604 1795636 1796802
> 1800644 1805573 1808795 1819168 1823855 1824247 1824859 1829581
> 1833814 1844403 1846747 1846965 1848715 1849941 1853839 1856511
> 1858005 1860160 1862651 1862689 1863230 1863505 1863551 1870133
> 1876425 1877992 1880464 1881005
> 6patient 6
> 26 940261 961510 976385 991244 991262 1034894 1039425 1079764 1118559
> 1139805 1141440 1172023 1178659 1186110 1195740 1196402 1208908
> 1209607 1221422 1260497 1291781 1307521 1336153 1347834 1361546
> 1441606 1447092 1460976 1485320 1510127 1513234 1522706 1555371
> 1565820 1574822 1583842 1600133 1622547 1634315 1642190 1653830
> 1676404 1676412 1776648 1788073 1803707 1845468 1847115 1848664
> 1858005 1872924 1873426 1873703 1874053 1874235 1874302 1874401
> 1874601 1874878 1875022 1875157 1875285 1875368 1875431 1875990
> 1876119 1876177 1876241 1876286 1876643 1876655 1876862 1877113
> 1877823 1877871 1877899 1877968 1878063 1878101 1878189 1878860
> 1879113 1879174 1879203 1879282 1879337 1879376 1879466 1879548
> 1879552 1879584 1879708 1879783 1879859 1881018 1881094 1881129
> 7patient 7
> 26 32 64 66 584 393119 495776 775556 935612 936179 942621 949141
> 949223 955632 957785 959720 960016 960102 961218 961823 966280 967417
> 977466 978148 987048 987577 988683 988742 988908 991253 1005078
> 1006155 1011888 1014615 1022586 1025957 1026844 1034756 1034828
> 1035700 1037143 1037204 1038839 1044246 1047892 1065529 1066425
> 1066636 1066840 1067483 1067534 1076209 1081015 1083726 1083860
> 1089217 1091246 1092235 1094322 1096930 1097352 1107825 1112065
> 1112364 1113716 1113780 1118554 1126088 1129754 1134338 1138248
> 1139794 1139805 1139836 1154762 1155347 1164690 1165164 1166266
> 1166555 1166736 1168774 1169979 1171772 1172421 1173770 1181337
> 1183346 1183574 1187020 1189521 1191324 1194027 1200144 1202642
> 1206258 1214448 1216474 1231296 1234485 1239933 1240291 1241788
> 1242610 1244977 1247143 1252319 1258585 1263353 1266374 1267667
> 1274579 1274729 1283559 1284205 1290016 1290344 1292369 1292946
> 1297529 1299095 1299957 1300293 1302300 1302308 1305232 1305296
> 1305300 1307405 1309401 1327852 1330083 1330861 1339556 1341368
> 1349157 1354179 1356644 1359345 1364973 1380332 1381901 1383833
> 1386879 1389106 1390842 1393860 1395372 1396201 1396380 1397384
> 1398644 1400803 1405777 1407162 1407704 1407731 1411028 1418455
> 1418800 1421000 1422426 1428940 1429576 1431061 1438082 1438527
> 1439587 1443266 1443600 1451910 1454168 1454641 1468508 1468973
> 1469883 1474810 1476704 1478266 1478721 1479874 1480103 1483941
> 1485157 1485599 1492110 1493546 1497113 1504070 1504963 1507617
> 1512253 1520427 1520846 1522706 1527985 1529103 1529318 1530194
> 1532718 1540183 1547326 1549918 1551273 1556426 1561426 1563047
> 1564273 1567404 1568763 1571193 1571479 1573294 1573457 1578883
> 1584771 1588619 1590396 1594116 1598891 1599032 1599333 1607195
> 1609947 1612075 1612886 1617915 1619078 1620602 1628412 1630464
> 1642190 1643026 1643895 1650854 1658446 1658816 1660977 1665091
> 1668105 1670594 1672854 1676528 1677625 1679957 1687738 1696519
> 1697322 1701691 1703860 1705688 1713016 1717720 1718848 1722577
> 1723949 1729768 1738579 1741293 1744697 1745945 1747682 1751848
> 1757025 1765030 1779393 1781202 1782944 1783697 1786104 1796708
> 1798785 1801361 1803295 1804016 1806650 1819891 1821345 1822559
> 1822589 1822695 1823689 1825965 1830263 1830680 1831733 1833260
> 1833284 1841565 1848844 1849195 1856222 1859144 1866039 1869866
> 1872836 1872854 1873031 1873361 1873452 1873560 1873663 1873729
> 1873791 1873886 1873917 1874121 1874378 1874415 1874458 1874569
> 1874644 1874758 1874823 1874891 1875202 1875285 1875414 1875481
> 1875598 1875643 1875702 1875972 1876220 1876228 1876308 1876533
> 1876558 1876635 1876755 1876872 1876934 1876938 1877078 1877100
> 1877213 1877251 1877289 1877331 1877376 1877533 1877641 1877684
> 1877743 1877771 1877772 1877778 1877861 1877890 1877931 1878063
> 1878089 1878092 1878122 1878272 1878305 1878364 1878450 1878581
> 1878756 1878918 1878946 1878960 1878983 1879010 1879055 1879079
> 1879278 1879385 1879420 1879442 1879499 1879500 1879555 1879557
> 1879635 1879697 1879787 1879795 1879803 1879808 1879843 1879885
> 1879958 1879978 1880072 1880171 1880222 1880362 1880549 1880688
> 1880708 1880841 1880927 1881068 1881099 1881128 1881195
> 8patient 8
> 593 945783 990049 1028921 1093578 1200227 1317205 1436867 1445985
> 1452101 1465272 1499604 1513254 1544010 1545048 1563094 1600136
> 1616182 1620396 1663606 1712554 1747317 1767701 1775386 1786960
> 1800355 1818340 1849076 1862167 1865850 1866648 1877968
> 9patient 9
> 26 941516 943397 943791 959199 966698 968932 1008909 1013581 1022548
> 1051182 1054993 1071369 1087158 1093077 1094274 1101611 1108933
> 1171304 1172974 1173850 1174313 1176114 1197897 1201501 1215653
> 1230624 1256628 1259051 1261414 1294311 1316445 1324177 1326204
> 1339908 1359050 1402712 1408585 1409880 1412294 1436258 1458878
> 1468508 1471453 1485432 1506220 1526517 1533413 1538560 1538789
> 1568518 1584771 1596589 1613509 1614720 1632284 1632658 1660870
> 1726306 1748045 1777931 1781729 1788433 1789750 1789802 1790140
> 1791242 1800415 1820039 1840651 1846965 1847924 1873407 1873414
> 1873955 1874439 1874857 1875491 1875666 1875786 1875993 1876108
> 1876326 1876767 1876800 1876801 1877550 1878120 1878312 1878846
> 1879330 1879564 1879884 1880298 1880657
> 10patient 10
> 75 943927 982765 983865 993618 993788 1000285 1000825 1000895 1003889
> 1004556 1006351 1008556 1030930 1031269 1033200 1034247 1041236
> 1042916 1043426 1045380 1049520 1057180 1066395 1071369 1072479
> 1075726 1080397 1088919 1108648 1109234 1115951 1131243 1133606
> 1149384 1170349 1172579 1176070 1179327 1200227 1202009 1202607
> 1221557 1222141 1241616 1260497 1262513 1268505 1271716 1281912
> 1282456 1299235 1299271 1302654 1317314 1324013 1332505 1335420
> 1338707 1349209 1355446 1362283 1381709 1384607 1391839 1391843
> 1405304 1407347 1416911 1418344 1418544 1425492 1430570 1436258
> 1449936 1452637 1456756 1459225 1461813 1466081 1483128 1483941
> 1487999 1504547 1506882 1509297 1518462 1519398 1522706 1523344
> 1525335 1537412 1539270 1540217 1543838 1544890 1546428 1548631
> 1549077 1551304 1561262 1575421 1582797 1597555 1601319 1605658
> 1606822 1608889 1609261 1618029 1619842 1621085 1621108 1628923
> 1631612 1652583 1653634 1662525 1672260 1676721 1688842 1689106
> 1692752 1693542 1694502 1698547 1698612 1698685 1703727 1711680
> 1713923 1721801 1734557 1741503 1751831 1763423 1768011 1770005
> 1771252 1772967 1774188 1774669 1779396 1787780 1798950 1801549
> 1814484 1819242 1822970 1825471 1826019 1829910 1830136 1832720
> 1833314 1833399 1833949 1835395 1837270 1842732 1845412 1845816
> 1847171 1847798 1847899 1851343 1851669 1852836 1852963 1855132
> 1866203 1866648 1870820 1873773 1874149 1874358 1876263 1878648
> 11patient 11
> 950624 963482 966051 1027704 1042829 1052291 1053952 1062942 1073137
> 1090790 1116227 1134144 1158695 1256118 1290211 1291781 1339282
> 1353539 1381811 1392991 1437378 1443585 1476524 1478057 1513234
> 1517879 1523097 1525431 1537405 1549794 1553229 1578883 1588619
> 1614273 1625009 1664779 1676414 1724067 1747213 1777304 1802488
> 1839055 1847129 1857358 1873093
> 12patient 12
> 26 945475 947593 951684 961555 964598 977781 981287 991594 1013581
> 1020301 1020318 1029973 1032947 1042933 1052191 1055234 1072195
> 1077128 1082162 1092974 1184050 1200227 1202958 1208490 1240211
> 1255932 1316737 1353058 1356393 1362816 1374494 1418800 1422775
> 1448495 1471453 1474438 1494633 1500836 1506220 1512909 1513094
> 1518720 1528462 1547897 1549077 1561426 1561741 1568208 1570512
> 1579454 1583627 1600133 1615366 1618996 1620602 1625940 1632138
> 1640631 1641304 1651049 1660870 1676040 1723762 1744296 1747353
> 1751105 1767701 1773235 1784725 1789390 1798547 1819242 1820706
> 1835945 1839536 1846172 1847129 1856275 1857171 1863521 1871728
> 1880684
> 13patient 13
> 75 526487 966459 1026812 1051434 1066228 1066252 1118554 1185816
> 1190307 1197067 1282438 1457988 1476524 1500836 1504070 1530453
> 1540106 1540706 1591685 1625225 1748150 1793900 1844356 1844403
> 1846965 1849503 1861733 1861943 1863873 1878641 1880315
> 14patient 14
> 939876 980424 989471 1015121 1017859 1042933 1048478 1052131 1088719
> 1094050 1096677 1110177 1143354 1153276 1158729 1159282 1165759
> 1166084 1215283 1239105 1249782 1310027 1311073 1348421 1350351
> 1352220 1402385 1415077 1448358 1450169 1454641 1458878 1465476
> 1485233 1501407 1509471 1541958 1542666 1543935 1545191 1557655
> 1574888 1580465 1587765 1603894 1617378 1644633 1648499 1689256
> 1710027 1728666 1734627 1736404 1755936 1764849 1774669 1787111
> 1833761
> 15patient 15
> 8 582 495613 940793 942263 950187 954713 955273 959692 962070 965418
> 967417 969844 970917 987733 991879 992848 992906 998193 1002838
> 1018845 1021670 1021778 1023337 1028516 1038339 1049624 1050086
> 1051434 1052610 1057630 1061972 1065872 1067803 1068034 1069262
> 1069901 1077518 1081289 1081696 1084913 1088745 1092420 1094289
> 1095832 1099323 1102778 1114091 1118308 1130355 1133684 1134144
> 1136827 1137973 1142113 1145822 1148554 1152977 1161489 1173385
> 1179283 1179997 1181656 1188473 1198466 1198803 1198905 1205952
> 1208514 1230822 1246651 1253050 1260990 1263277 1267689 1272413
> 1284360 1284942 1287207 1293171 1301195 1304432 1305012 1309182
> 1309186 1329625 1331944 1347659 1349127 1357523 1363456 1372319
> 1374520 1385610 1391254 1393098 1395291 1397217 1397882 1418009
> 1418449 1419127 1425099 1426587 1429545 1433695 1433934 1434166
> 1434408 1439637 1485017 1486765 1497695 1498114 1500938 1500955
> 1504547 1522901 1526652 1539590 1547758 1578315 1579560 1579729
> 1583309 1585309 1586242 1588889 1595730 1601666 1602933 1609378
> 1611307 1613139 1614158 1616000 1618610 1624158 1631322 1636898
> 1643891 1646250 1648387 1650270 1653634 1653674 1655263 1658100
> 1666013 1666338 1670882 1675099 1676981 1701885 1709501 1710333
> 1721179 1723017 1729405 1730585 1730735 1731525 1739661 1746525
> 1747313 1755855 1763977 1764777 1765030 1765442 1768608 1785894
> 1789920 1795485 1800601 1808317 1817968 1824273 1825969 1826711
> 1833963 1834098 1834857 1835588 1837249 1840230 1841309 1841721
> 1842323 1842491 1847411 1848730 1850719 1851376 1852032 1853745
> 1856606 1861958 1864798 1865670 1866600 1871448 1874127 1875907
> 1876381 1878641 1879635
> 16patient 16
> 943792 954408 957421 960567 1033243 1055654 1058608 1079764 1087279
> 1115894 1148038 1155347 1164810 1165158 1170974 1213341 1241038
> 1277863 1305877 1316445 1325283 1367804 1454878 1504070 1519859
> 1529771 1574080 1658470 1659037 1708182 1723762 1747213 1800366
> 1835083 1853839
> 17patient 17
> 25 1213341 1695018 1747176 1859529
> 18patient 18
> 593 991594 1020774 1068034 1073831 1108747 1116227 1200882 1256182
> 1436197 1542750 1558691 1622547 1643003 1659555 1703843 1819506
> 1823082 1873021 1874605 1874665 1874705 1874878 1875368 1876277
> 1876280 1876640 1876690 1877052 1877074 1877159 1877415 1877612
> 1877978 1878523 1879398 1879403 1879420 1879424 1879978 1880070
> 1881171
> 19patient 19
> 1079764 1154626 1244380 1281470 1409425 1573241 1688215 1742485
> 1756007 1846683 1879987 1880315
> 20patient 20
> 495798 963474 973836 975882 989120 1079764 1154721 1171299 1329625
> 1517186 1525335 1587319 1873554 1873919 1874186 1874641 1875328
> 1875368 1875502 1875643 1876102 1876108 1876263 1876365 1876391
> 1877251 1877470 1877487 1877871 1878069 1878072 1878320 1878382
> 1878505 1879113 1879395 1879432 1879665 1879859 1880697 1881133
> 1881283
> ---------------------------------------------------------
>  On Fri, Mar 9, 2012 at 1:08 PM, Henrik Bengtsson
> <henrik.bengts...@aroma-project.org> wrote:
>> Hi.
>>
>> I see, the instructions I gave you before did not write copy numbers
>> *relative to a reference*, but copy number *signals as-is* (=on a
>> non-standardized scale).  The latter is what is outputted by CRMAv2.
>> The task of standardizing toward a reference is passed on to
>> downstream methods, e.g. CBS segmentation.  To calculate total copy
>> numbers *relative to a reference*, also known as "total copy-number
>> ratios", see:
>>
>> http://aroma-project.org/howtos/exportTotalCnRatioSet
>>
>> Here is a summary/sketch of what your script should look like:
>>
>> library("aroma.affymetrix");
>>
>> dataSet <- "2012";
>> chipType <- "GenomeWideSNP_6";
>>
>> # CRMAv2 preprocessing of raw signals => total CN *signals*
>> dsN <- doCRMAv2(dataSet, chipType=chipType, verbose=verbose);
>> print(dsN);
>>
>> # Calculate the reference as the pool of all samples
>> dfR <- getAverageFile(dsN);
>>
>> # Calculate total CN *ratios* (on the non-log scale) relative to the pool.
>> dsTCN <- exportTotalCnRatioSet(ds, dfR, logBase=NULL, verbose=verbose);
>> print(dsTCN);
>>
>> # Workaround for problem with '#' in exported column names
>> setFullNamesTranslator(dsTCN, function(names, ...) {
>>  gsub("#", "No",names, fixed=TRUE);
>> });
>>
>> # Export total CN *ratios* relative to pool together with annotation data
>> dsTxt <- writeDataFrame(dsTCN, columns=c("unitName", "chromosome",
>> "position", "*"));
>> print(dsTxt);
>>
>>
>> Comments on your code below...
>>
>> On Wed, Mar 7, 2012 at 6:52 AM, Yu Song <ys...@oakland.edu> wrote:
>>> Dear Henrik,
>>>
>>> Imet this when I was creating data files containing log2 CN ratios as 
>>> follows:
>>
>> I see what you're trying to do, but unfortunately there are some
>> mishaps.  I've added some hints on how you can troubleshoot/understand
>> why it does not work.
>>
>>> ------------------------------------------------------------------------------------------------------------
>>>> dfa <- getAverageFile(ds);
>>>> dfa=readDataFrame(dfa)
>>>> dfn=matrix(NA,length(dfa),20)
>>
>> Check if the dimension of the allocated 'dfn' matrix is what you expect, e.g.
>>
>> str(dfn)
>>
>>>> for (i in 1:20) {
>>> +       cat(i)
>>> +       dfi=getFile(ds, i)
>>> +       dfi=readDataFrame(dfi)
>>> +       dfn[,i]<-log2(dfi/dfa);
>>
>> Is 'dfa' and 'dfi' really what you except here?  Look at str(dfa) and
>> str(dfi).  What do you expect them to me and what do you except
>> log2(dfi/dfa) to return.
>>
>>> +    # dsTxt <- writeDataFrame(dfn, columns=c("unitName",
>>> "chromosome", "position"));
>>
>> writeDataFrame() does not accept matrices ('dfn') as input.  But even
>> so, here you try to write the matrix in every iteration of the loop.
>> If at all, it should be written after the loop.
>>
>> I leave it at that.  For the correct solution, see my sketch above.
>>
>> /Henrik
>>
>>> + }
>>> 12Error in dfn[, i] <- log2(dfi/dfa) :
>>>  incorrect number of subscripts on matrix
>>> In addition: Warning messages:
>>> 1: In FUN(X[[1L]], ...) : NaNs produced
>>> 2: In FUN(X[[1L]], ...) : NaNs produced
>>> ---------------------------------------------------------------------------------------------------
>>> So that there is only dfn[1] created, not dfn[2]...dfn[20].
>>> Is there a way to get across the NaNs that bars me against creating this 
>>> file?
>>>
>>> Thanks a lot.
>>> Yu
>>>
>>> On Mon, Mar 5, 2012 at 10:15 PM, Henrik Bengtsson
>>> <henrik.bengts...@aroma-project.org> wrote:
>>>> 20 data files should be no problems. I'm still quite sure that you
>>>> have '#' in your generated column names.  Could you send a file
>>>> containing the first 30 rows of the generate
>>>> '2012,ACC,ra,-XY,BPN,-XY,AVG,A+B,FLN,-XY,total.txt' file?
>>>>
>>>> /Henrik
>>>>
>>>> On Mon, Mar 5, 2012 at 7:05 PM, Yu Song <ys...@oakland.edu> wrote:
>>>>> Dear Henrik,
>>>>>
>>>>> Thank you for this insight! That's the reason I renamed them and rerun
>>>>> the prenormalization, the CBS and then exported the data to the text
>>>>> tile, but still I got the same error message as I said in the last
>>>>> email(The error message I post was after the rename of the affymetrix
>>>>> CEL files).
>>>>>
>>>>> In general, I run the prenormalization, the CBS and writeDataFrame
>>>>> both before and after the changing of the CEL file names, got the same
>>>>> error message. It could eliminate the odd of incompatibility of the
>>>>> file name. Do you think it might be the problem with too many
>>>>> patients(20)?
>>>>>
>>>>> Thanks a lot for your help!
>>>>> Yu
>>>>>
>>>>> On Mon, Mar 5, 2012 at 2:29 PM, Henrik Bengtsson
>>>>> <henrik.bengts...@aroma-project.org> wrote:
>>>>>> Hi Yu,
>>>>>>
>>>>>> the quick answer is that your file has been successfully written, but
>>>>>> depending on where you're loading it, the column names may not be
>>>>>> correctly parsed.  The easy fix is to manually replace all '#'
>>>>>> characters with, say, 'No' in the column names of the generated file.
>>>>>> Alternatively, you can do the following trick before calling
>>>>>> writeDataFrame() to have this done from within R:
>>>>>>
>>>>>> setFullNamesTranslator(ds, function(names, ...) { gsub("#", "No",
>>>>>> names, fixed=TRUE) });
>>>>>>
>>>>>> More details below...
>>>>>>
>>>>>> On Sat, Mar 3, 2012 at 8:13 PM, Yu Song <ys...@oakland.edu> wrote:
>>>>>>> Hi Henrik,
>>>>>>>
>>>>>>>  Thanks for the help on "Write data as a tab-delimited text file".
>>>>>>>
>>>>>>>  I met a problem when doing "Export all data of a data set to a
>>>>>>> tab-delimited text file with annotation data added":
>>>>>>>
>>>>>>>  The error said: "more columns than column names" when I command 
>>>>>>> writeDataFrame.
>>>>>>>  The screensnap is attached.
>>>>>>>  I have 20 patients in files which I doubted the way it named might be
>>>>>>> the problem:
>>>>>>> ------------------------------------------------------------------------------------
>>>>>>>  SX0080817D JK 268 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX00808177 MP 303 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX00808174 MW 384 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX0080816E DC 325 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX0080816B DD 383 Mar 23 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX00808168 KA 383 Mar 23 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX00807e37 DK 226 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  SX00807E2A GJ 7 Mar 12 2010_(GenomeWideSNP_6),total.asb
>>>>>>>  #9 (work #159) SX00811CFA (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #8 re-do (work #159) SX00811D02 (1.31.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #7 re-do (work #159) SX00811CF1 (1.31.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #5 (work #159) SX00811CFC (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #4 (work #159) SX00811CFB (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #19(work #159) SX00811CFF (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #18 (work #159) SX008144F8 (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #14 (work #159) SX00811CFE (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #13 (work #159) SX00807DEE (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #12 (work #159) SX008144FE (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #11 (work #159) SX00811CEF (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>>  #1 (work #159) SX00808A11 (01.17.12)_(GenomeWideSNP_6),total.asb
>>>>>>> ------------------------------------------------------------------------------------------------------------------------------
>>>>>>> I tried modifying the file name in case if aroma is name sensitive.
>>>>>>> Then I rerun the prenormalization, the CBS and exportation the data to
>>>>>>> text tile, but still I got the same error message:
>>>>>>
>>>>>> You mean to say *case* sensitive?  That would not make difference.
>>>>>> More below...
>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------------------------------------------------------
>>>>>>>> dsTxt <- writeDataFrame(ds, columns=c("unitName", "chromosome", 
>>>>>>>> "position", "*"));
>>>>>>> Error in list(`writeDataFrame(ds, columns = c("unitName",
>>>>>>> "chromosome", "position", "*")` = <environment>,  :
>>>>>>>
>>>>>>> [2012-03-03 23:02:07] Exception: File format error of the tabular file
>>>>>>> ('totalAndFracBData,txt/2012,ACC,ra,-XY,BPN,-XY,AVG,A+B,FLN,-XY/GenomeWideSNP_6/2012,ACC,ra,-XY,BPN,-XY,AVG,A+B,FLN,-XY,total.txt'):
>>>>>>> more columns than column names
>>>>>>>  at throw(Exception(...))
>>>>>>>  at throw.default("File format error of the tabular file ('", 
>>>>>>> getPathname(thi
>>>>>>>  at throw("File format error of the tabular file ('", 
>>>>>>> getPathname(this), "'):
>>>>>>>  at value[[3]](cond)
>>>>>>>  at tryCatchOne(expr, names, parentenv, handlers[[1]])
>>>>>>>  at tryCatchList(expr, classes, parentenv, handlers)
>>>>>>>  at tryCatch({
>>>>>>>  at verify.TabularTextFile(this, ..., verbose = verbose)
>>>>>>>  at verify(this, ..., verbose = verbose)
>>>>>>>  at TabularTextFile(pathname, sep = sep)
>>>>>>>  at writeDataFrame.AromaUnitSignalBinarySet(ds, columns = c("unitName", 
>>>>>>> "chro
>>>>>>>  at NextMethod("writeDataFrame", this, filename = filename, ...)
>>>>>>>  at writeDataFrame.AromaUnitTotalCnBinarySet(ds, columns = 
>>>>>>> c("unitName", "chr
>>>>>>>  at writeDataFrame(ds, columns = c("unitName", "chromo
>>>>>>
>>>>>> Reading this stacktrace backwards, the error is generated in
>>>>>> TabularTextFile(), which is called by writeDataFrame() [at the very
>>>>>> end] to assert that the generated file can be properly parsed by R.
>>>>>> Because you have '#' in your filenames, which becomes column names,
>>>>>> the assertion test identifies a "conflict" with column names having
>>>>>> '#":s and the file header comments starting with '#':s.  I've
>>>>>> overlooked this use case, and I'll add it to the todo list to either
>>>>>> detect & warn about this, or possible make TabularTextFile() smarter
>>>>>> about this case.
>>>>>>
>>>>>> /Henrik
>>>>>>
>>>>>>> ----------------------------------------------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>  Thanks a lot!
>>>>>>>
>>>>>>> Yu
>>>>>>>
>>>>>>> On Fri, Mar 2, 2012 at 12:07 PM, Henrik Bengtsson
>>>>>>> <henrik.bengts...@aroma-project.org> wrote:
>>>>>>>> Hi.
>>>>>>>>
>>>>>>>> On Fri, Mar 2, 2012 at 8:52 AM, Yu Song <ys...@oakland.edu> wrote:
>>>>>>>>> Dear Mr.Bengtsson,
>>>>>>>>>
>>>>>>>>> I am trying to create a data containing the "unitName", "chromosome"
>>>>>>>>> and "position" from the output CEL of preprocessing.
>>>>>>>>
>>>>>>>> What type of CEL files?  What type of preprocessing?
>>>>>>>>
>>>>>>>> /H
>>>>>>>>
>>>>>>>>> Is there a certain command to do this?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> Yu Song
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best regards,
>>>>>>> Yu Song
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best regards,
>>>>> Yu Song
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Yu Song
>
>
>
> --
> Best regards,
> Yu Song

-- 
When reporting problems on aroma.affymetrix, make sure 1) to run the latest 
version of the package, 2) to report the output of sessionInfo() and 
traceback(), and 3) to post a complete code example.


You received this message because you are subscribed to the Google Groups 
"aroma.affymetrix" group with website http://www.aroma-project.org/.
To post to this group, send email to aroma-affymetrix@googlegroups.com
To unsubscribe and other options, go to http://www.aroma-project.org/forum/

Reply via email to