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:
parent
4bfec4c55b
commit
133712faec
|
|
@ -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
|
||||||
Loading…
Reference in New Issue