Open antonkulaga opened 7 years ago
For the use case you describe above, I think it would be better handled by #194 - read the TSV with a header and cast the result to a struct. This will be available in WDL 1.2.
For creating a subset of an array, currently you can do:
Array[Int] my_array = [1,2,3]
for (i in range(1, 3)) {
my_new_array = my_array[i]
}
# my_new_array == [2,3]
I agree this is not elegant, but I'm not sure how common the need is to do something like this.
We could add a function like:
Array[Int] my_subset = subset(my_array, 1, 3)
I also wouldn't mind if this were polymorphic over String
as well:
String my_string = "hello"
String substring = subset(my_string, 1, 3)
# substring == "el"
Very often I need to slice an array. For instance, in RNA-Seq experiments I have tsv files with first column as a condtion and all subsequent as GSM ids for samples. It would be useful to get all elements of array except the first. I would love to have something either like Scala's head/tail or like Python access for slices of the array.