GATKPath类是GATK(基因组分析工具包)中的一个专门类,它扩展了HtsPath并实现了TaggedArgument。它提供了一种处理文件路径的方法,这些路径可以位于不同的存储系统上,如本地文件系统、谷歌云存储(GCS)或Hadoop分布式文件系统(HDFS)。此外,它还支持对命令行参数进行标记。
Key Components of GATKPath
Class
-
Fields and Constants:
HDFS_SCHEME
: A constant for identifying HDFS URLs.tagName
: Holds the tag name for the path.tagAttributes
: A map of attributes associated with the tag.
-
Constructors:
GATKPath(String uriString)
: Initializes with a URI string.GATKPath(GATKPath sourceGATKPath)
: Copies an existingGATKPath
and propagates its tag and attributes.
-
Methods:
toPath()
: Converts theGATKPath
to aPath
object. Handles GCS paths specially by usingBucketUtils.getPathOnGcs()
and falls back to usingFileSystems
if the path is not found.getInputStream()
: Returns anInputStream
for reading from the path. Handles different schemes like HDFS and local file systems.getOutputStream()
: Returns anOutputStream
for writing to the path. Supports HDFS and local file systems.isHadoopURL()
: Checks if the path uses the HDFS scheme.setTag(String tagName)
: Sets the tag name.getTag()
: Gets the tag name.setTagAttributes(Map<String, String> attributes)
: Sets the tag attributes.getTagAttributes()
: Gets the tag attributes.toString()
: Returns a string representation of the path including any tags and attributes.equals(Ob