【发布时间】:2012-05-15 03:02:53
【问题描述】:
示例文件已上传至MediaFile。
背景信息
第 1 部分:在示例文件中,“Sheet1”
a. Values in “Column A” are the original name. For example from Cell A1:
“>hg19_refGene_NM_000392_0 range=chr10:101542463-101542634 5'pad=0 3'pad=0 strand=+ repeatMasking=none”
b. Values in “Column B” is a value that correspond to values in Column A, for example
from Cell B1 which correspond to value in Cell A1: “ABCC2”
第 2 部分:在示例文件中,“Sheet2”
a. In the Sheet2, the values from Sheet1 have been separated to clarify the data because
in Sheet1, everything is packed in one cell.
b. Column A represents “GENE”, which refers to the value in Column B in Sheet1, for example,
“ABCC2” from Section 1 of this article.
c. Column B represents “refGENE”, an example of refGENE is “NM000392” which come from the
original name from “Sheet1”
d. Column C represents “CHROMOSOME”, this is another value that was derived from Values in
Column A of Sheet1, for example, “chr10”
e. Similar Idea, “EXON START” came from the original name in Column A of Sheet1, for
example “101542463”
f. And “EXON END” came from the original name in Column A of Sheet1, for example “101542634”
挑战是开发一个可以解决以下要求的程序:
要求1:统计每个基因,每个refGene被观察到的次数,例如:
Table Example refGENE COUNT NM000927 29 NM00078 32 NM00042 32 . . . . . .
注意:我这样做的方法是在 Excel 中使用 SUMPRODUCT,但是,我不知道如何将所有内容放在一个简单的表格中。
要求 2: 这需要比较两个不同行中的值,请注意,这需要使用“Sheet1”中的原始名称。请不要使用“Sheet2”中的分隔值。 基本上就是查询每一行,如果Gene, Chromosome, EXONSTART, EXON END 相同,则删除refgene 频率最低的行。我将在下面进一步解释。
在“Shee1”中,有“Original Name”和“GENE”,
第 1 步:比较 B 列中的值是否相同。例如,比较第 1 行和第 2 行时,有ABCC2 和ABCC2。这满足条件,所以继续第2步,否则继续比较不同行的GENE。
第 2 步:比较不同行的“chr”值,与上一步的示例相同。第 1 行有chr10,第 2 行有chr10,因为它们相同,继续下一步,否则继续。
第 3 步: 现在比较“exon start” - 第 1 行中的数字看起来像 101542463,而第 2 行中的数字看起来像 101544365,现在它们不一样了,保存文件并继续。想象一下,如果数字相同,那么继续比较“外显子端”,也就是第4步。
第四步:假设两个不同行的“exon start”相同,然后比较“exon end”。第 1 行的数字看起来像 101542634,第 2 行的“外显子末端”数看起来像 101544538。与上述条件相同,如果不同,则不处理该文件,继续比较下一个 GENE。
这里是需要注意的部分,如果相同,则表示“GENE”相同,“chr”相同,“exon start”和“exon end”相同。最后,一切都是一样的,这意味着有一个重复的行。现在,重复的行将被删除。但是删除该行的条件是什么。这将使我们回到我们从需求 1 中解决的挑战。还记得所有 refGENE 的出现次数都已计算吗? NM000927 调用 29 次,Nm00078 调用 32 次。要删除的“GENE”行是包含NM000927 的行。
但是,请保留所有已删除数据以及所有剩余数据的记录,最好用表格。
【问题讨论】:
-
我不明白 -ve 投票?用户已尽力尽力解释问题。反转投票。 @Maggie Mi:
1)Sheet2 没有您帖子中提到的任何数据?2)要获得如上图所示的表格,您始终可以使用数据透视表而不是 Sumproduct()。 :) -
不,我不能一直用那个,因为这只是基因的一部分,整个部分将超过20,000个数据,我不确定这样做是否仍然合适?跨度>
-
也非常感谢您的回答
-
@MaggieMi:这与您提出的其他问题有关吗?你也错过了我的第一个问题......
1) Sheet2 doesn't have any data as your post mentioned? -
@SiddharthRout:签名....我的老板看到我做不到,然后请别人做我的工作...但仍然感谢您到目前为止的帮助。
标签: excel excel-formula pivot-table countif vba