I am trying to find an effective way to this. I have the annotation file for the Axiom Human Origins array from which the data comes from, so I know the proper ids.
I was wondering if anyone could suggest a good bash/Python/Perl based method to this. The idea I had in mind was the
sed -i 's/*Affy#*/*rs#*/g' *filename*
method, but I figure this would not be the most efficient as it would be >600,000 replacements. Any suggestions? Thanks!
if you can use a command line tool it will likely be the more efficient
than relying on perl.
I'd suggest you pipe your output instead of doing an inline replace just to
ensure you have an un-tainted file to come back to in the event of a
mistake.
-- Dylan B. Storey
<h6></h6>
Post Doctoral Researcher
University of California, Davis
1089 Veterinary Medicine Drive
4016 VM3B
Davis Ca 95616
1-(714)-425-0620
<h6></h6>
"There is a single light of science, and to brighten it anywhere is to
brighten it everywhere."- Isaac Asimov
Any suggestions on what kind of command line tool to use? I am new to this stuff. I have previously been told to use a scripting language like Perl/Python, but I am not sure how to implement it.
Why do you think it would re read the file every time? Sed works on a stream. You literally posted the exact solution you needed as a one line sed solution. Am I missing something about the replacement pattern?
Affx-23483877 changes to rs10000011
Affx-21814892 changes to rs1000002
Affx-25184125 changes to rs10000023
Affx-23002973 changes to rs1000003
Affx-23821302 changes to rs10000041
Affx-23694978 changes to rs10000046
Affx-23977073 changes to rs10000057
Affx-24508350 changes to rs10000073
Affx-24214680 changes to rs10000092
If you already have the one to one mappings in a file. Build a hash (or dict) in perl (python) by reading in and parsing previously mentioned file. (maybe 5 lines).
Then read your other file in and do look ups and replacements.
--
Dylan B. Storey
Post Doctoral Researcher
University of California, Davis
1089 Veterinary Medicine Drive
4016 VM3B
Davis Ca 95616
1-(714)-425-0620
"There is a single light of science, and to brighten it anywhere is to brighten it everywhere." - Isaac Asimov
Posting if anyone might have similar problem.
This is easily done with plink update