This is a programming and project management problem.
I haven't done much programming for a while.
I am using the two blogs separately even though they are sort of combined.
Then I am using and learning R and Javascript at the same time.
It's all a bit complex!
In order to not lose my mojo, I need to work out where I am at and build in the plan to review that.
Last two edited files on my Aptana workspace was:
NFkB_Pathway_info.txt
MultipleUniprotAccNumber_Clean_20140509.html
Last git commit was on the 6th of May.
So that suggests that I haven't done any programming for 11 days...
Let's open that file and see how I do...
Wednesday, 21 May 2014
Tuesday, 20 May 2014
How the proteins array is organised...
I have created the file with the name of:
MultipleUniprotAccNumber_rearrange_array_20140520.html
Key commands for making the array
in a loop that goes through each of the IDs
get the info from the XML file
in loop that goes through each of the features
protein[i] =Array(type[i], desc[i], stat[i], start[i], end[i]);
then combine this with
MultipleUniprotAccNumber_rearrange_array_20140520.html
Key commands for making the array
in a loop that goes through each of the IDs
get the info from the XML file
in loop that goes through each of the features
protein[i] =Array(type[i], desc[i], stat[i], start[i], end[i]);
then combine this with
proteins.push(protein);
Now proteins is organised with
- an array for each protein
- an array for each feature
- five bits of info for each feature (type, desc, status, start, end)
proteins.length give the number of proteins (ordered by UniID)
protein[i].length gives the number of features for protein[i]
proteins[2][0][0] returns the type of the first feature of the third protein.
Now I should be able to loop through these all relatively easily.
Today has been spent trying to learn about arrays...
I wrote the script below to try to understand how the Array function and the push function to assemble different arrays.
<script>
var array1 = [1,2,3,4,5];
var alphaarray = ["a","b","c","d","e"];
var arrayarray = [];
var pusharray = [];
var anotherpusharray = [];
for (i = 0; i < array1.length; ++i)
{
arrayarray[i] =Array(array1[i], alphaarray[i]);
pusharray.push(array1[i],alphaarray[i]);
}
anotherpusharray.push(array1, alphaarray)
document.write("<br>");
document.write("<br>");
document.write(arrayarray);
document.write("<br>");
document.write("<br>");
document.write(arrayarray[0]);
// output put is 1,a
document.write("<br>");
document.write("<br>");
document.write(pusharray);
document.write("<br>");
document.write("<br>");
document.write(pusharray[0]);
// output looks the same for both arrayarray and pusharray even though the information is differently organised.
// the different organisation is demonstrated by what happens when you write the first element from each array. The first element from
// arrayarray is [1,a]
document.write("<br>");
document.write("<br>");
document.write(anotherpusharray);
document.write("<br>");
document.write("<br>");
document.write(anotherpusharray[0]);
document.write("<br>");
document.write("<br>");
document.write(anotherpusharray[0][0]);
//
</script>
Learning more about R
Some advice about R-studio from Stuar51XT through a Youtube video (https://www.youtube.com/watch?v=qHfSTRNg6jE)
some notes:
clear console: Contol L
clear workspace: clear all tab
To use a piece of script:
Open script window
Write script
Highlight script
Press run
To use a file
Put script in a file with a .R suffix.
source function will run the file - as long as it can find it....
source("z.R")
Get working directory
getwd()
some notes:
clear console: Contol L
clear workspace: clear all tab
To use a piece of script:
Open script window
Write script
Highlight script
Press run
To use a file
Put script in a file with a .R suffix.
source function will run the file - as long as it can find it....
source("z.R")
Get working directory
getwd()
Thursday, 8 May 2014
Multiple panels in R
Some useful tips here:
http://www.statmethods.net/advgraphs/layout.html
http://www.statmethods.net/advgraphs/layout.html
Heatmaps 2
Interesting piece on the web here:
http://mannheimiagoesprogramming.blogspot.co.uk/2012/06/drawing-heatmaps-in-r-with-heatmap2.html
http://mannheimiagoesprogramming.blogspot.co.uk/2012/06/drawing-heatmaps-in-r-with-heatmap2.html
Data Analysis for Suliman...
So I am going to try to do this now.
I will prepare a Powerpoint file with the pictures in there and send it to Ian and Suliman for comment.
Starting about 14:15.
Cleaning the combined data frame for a heat map:
useful command is subset
> keep <- subset(cleanboth, select = -Pat_12)
This removes the data from Patient 12
> keep <- subset(keep, select = Accession)
Just leaves the Accession column...
> x <-keep[complete.cases(keep), ]
Focusses on just the samples with no missing values.
Sadly on 189 observation.
Now 15:54.
Managed to do lots of stuff but didn't manage to produce heatmap.
It thinks the data.frame is NOT numeric so it won't allow me to make the heatmap.
Try again later.
A few pages of data to send to Suliman for some feedback.
I will prepare a Powerpoint file with the pictures in there and send it to Ian and Suliman for comment.
Starting about 14:15.
Cleaning the combined data frame for a heat map:
useful command is subset
> keep <- subset(cleanboth, select = -Pat_12)
This removes the data from Patient 12
> keep <- subset(keep, select = Accession)
Just leaves the Accession column...
> x <-keep[complete.cases(keep), ]
Focusses on just the samples with no missing values.
Sadly on 189 observation.
Now 15:54.
Managed to do lots of stuff but didn't manage to produce heatmap.
It thinks the data.frame is NOT numeric so it won't allow me to make the heatmap.
Try again later.
A few pages of data to send to Suliman for some feedback.
Subscribe to:
Posts (Atom)