Exmple of Sorting a Map


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def sortedCount = badSnpsMap.keySet().toList()
  2. sortedCount.sort{ badSnpsMap[it] }
  3.  
  4. println "Bad SNPS count"
  5. println "-------------------------------------------------"
  6. sortedCount.reverse().each { probeSetId ->
  7. println "" << probeSetId << "\t\t" << badSnpsMap[probeSetId]
  8. }
  9.  
  10.  
  11. your: 2for: 1
  12. """
  13. recipes: 1

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.