Have a list of bam files but Picard updated their versions from v1 to v17 ? This script will update all your v* numbers for you.

PS: don't hate Lua. :-)

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5857 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
carneiro 2011-05-23 21:46:14 +00:00
parent 4bfec4c55b
commit 133712faec
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
function latestVersion(sample)
local version = tonumber(sample:match("/v(%d+)/"))
f = io.open(sample)
while (f == nil) do
version = version + 1
sample = sample:gsub("/v(%d+)/", "/v"..version.."/")
f = io.open(sample)
end
return(sample)
end
for sample in io.lines(arg[1]) do
print(latestVersion(sample))
end