Some assistance with respect to the following problem will be very helpful.
I want to reformat my dataset in the following manner for subsequent analysis.
I have first column values (which repeat for each value of 2nd column) which are names, the second column specifies position ad the third column is
the 1st value, fourth column is 2nd value. I want to put the names as column headers and the values for a particular position as the value of the 4th column in the input. In case of missing record, it should take the value of the third column of any record for that position.
For example in the input dataset, A through D are the names and C does not occur for pos2, and B,C,D does not occur for pos3. So the value of C for pos2 will be taken from the tird column of any record for pos2 which is 9 (third column is constant for a particular pos ). For pos3, only B will have value 9 while A, C and D will have 7 (third column for pos3).
For the record, I have 80 names and 15677899 records in my actual dataset.
I have a way to do this, but it will need to be told what the columns are, since it can't go backwards and insert the first line after it's collated everything.
thank you for letting me join this forum, lots of learning opportunities looks like.
Myself a biologist, very new into unix, so please excuse if I use incorrect language. I am using cygwin on windows, it can run perl, awk , sed etc.
I have 2 files, the first sample sheet, tells which parent... (10 Replies)
I need to form a matrix out of unbalanced set of records. First eliminate the sample that do not have at least 3 variables (col2). So, in the example, samples 4 and 5 get eliminated.
Then form a matrix of values (col3) from the samples using only variables that are present accross all samples.... (3 Replies)
is it possible to order the following row clusters from ascending to descending. thanx in advance
input
1 2 4 0
1 2 4 0
3 3 3 3
1 5 1 0
1 5 1 0
6 0 0 0
5 1 1 1... (4 Replies)
is it possible to count the number of keys based on state and cell and output it as a simple matrix.
Ex: cell1-state1 has 2 keys
cell3-state1 has 4 keys.
Note: Insert 0 if no data available.
input
key states cell
key1 state1 cell1
key1 state2 cell1
key1 ... (21 Replies)
Hi all,
Is there a way to convert full data matrix to linearised left data matrix?
e.g full data matrix
Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7
Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245
Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
I have large formatted data file with five columns. This has to be rearranged in lower order matrix form as shown below for sample data.
1 2 3 4 5
1.0
3.0 2.0
5.0 3.0 2.0
4.0 3.0 1.0 6.0
2.0 3.0 4.0 5.0 1.0
1.0 4.0 2.0 3.0 5.0
3.0 5.0 4.0 2.0 8.0
1.0 3.0 2.0 4.0 5.0
2.0... (7 Replies)
Dear AWK Users,
I have a data set that is so large (Gigabytes) that it cannot be opened in the vi editor in its entirety. But I can manipulate the entire thing in AWK. It is formatted in a regular manner such that it has the variable descriptions or listings preceeding the variables. The latter... (13 Replies)
Hi,
I have a file whose structure is like this
7
7
1 2 3 4 5
1 3 4 8 6
1 4 5 6 0
2 6 8 3 8
2 5 7 8 0
5 7 9 4 1
3 8 0 2 2
3 5 6 8
basically first two row tell the number of rows and column but the data following them are not arranged in that format. now i want to create another... (1 Reply)