Comments (9)
Even simpler version with an open-ended scope for all columns greater then 5.
Robust Nth Column Selection
%YAML 1.2
---
name: faidx
file_extensions: [fa.fai,fasta.fai]
scope: source.faidx
# Fasta Index Filetype Description
# NAME Name of this reference sequence
# LENGTH Total length of this reference sequence, in bases
# OFFSET Offset within the FASTA file of this sequence's first base
# LINEBASES The number of bases on each line
# LINEWIDTH The number of bytes in each line, including the newline
contexts:
main:
# COLUMN 1
- match: '^[\S]*\t'
scope: coord.Chr.faidx
push: col2
col2:
# COLUMN 2
- match: '[\S]*'
scope: coord.Start.faidx
- match: \t
push: col3
- match: $
pop: true
col3:
# COLUMN 3
- match: '[\S]*'
scope: constant.numeric.faidx
- match: \t
push: col4
- match: $
pop: true
col4:
# COLUMN 4
- match: '[\S]*'
scope: comment.line.faidx
- match: \t
push: col5
- match: $
pop: true
col5:
# COLUMN 5
- match: '[\S]*'
scope: comment.line.faidx
- match: \t
push: colast
- match: $
pop: true
colast:
# Any COLUMN >5
- match: .*
scope: comment.line.faidx
pop: true
from biosyntax-archive.
This is really cool.
I think it looks pretty robust as it is. Though, would it work for files with >5 columns? Might need to do some figuring out on how to encode the 5th column if there is a 6th column. Maybe something along the lines of '(?<=\t[\S]\t)[\S]\t'?
from biosyntax-archive.
brilliant!
from biosyntax-archive.
I think this same logic could be applied for gedit and Vim syntax as well. There is a Match Start // Match End logic which can be extended in this way. I would say if we figure this out soon we'll simplify our lives greatly.
Maybe read some syntax highlighting files for other complex langauges (C / XML etc...) to learn how other people solved similar problems.
from biosyntax-archive.
Can we get a screenshot of what it looks like @ababaian ?
from biosyntax-archive.
from biosyntax-archive.
Please can you give me the colors you used to do this colors scheme?
from biosyntax-archive.
I'd say let's not worry 100% about all the color schemes just yet. This was based off of bioMonokai for Sublime which is dark background. Gedit is based off of Kate and is light background so it might not work. The third column is simply the default 'numeric' color, fourth + fifth are comment colored.
We're going to have to formalize all the colors and/or set one dark one light theme to make the same for all the different programs. We can worry about this last; now we need the syntax files to work reliably for all the different software as the highest priority.
from biosyntax-archive.
Also faidx-gedit syntax
Check out Fasta Index Language File for an example of the logic. It's the same thing as in sublime / less where nested contexts can be used to select by column. This should make SAM/VCF/BED/GTF files much much easier to deal with.
from biosyntax-archive.
Related Issues (20)
- hackseq Day 3 Goals
- Feature List (To Do)
- Porting to vim HOT 5
- Biosyntax Publication HOT 8
- File Format / Syntax Compatibility Matrix HOT 3
- Porting core syntax to gedit HOT 14
- Porting to less HOT 5
- Fixing GTF Syntax HOT 13
- Porting to Atom HOT 1
- bioSyntax Meeting 1 HOT 8
- bioSyntax Meeting 2 HOT 2
- Polish SAM syntax highlighting capability HOT 7
- Sprint Meet-up - Nov 20th + 24th HOT 2
- Sublime-Fastq Syntax breaks when comment included HOT 1
- bioSyntax Release TODO HOT 1
- bioSyntax TODO -- Post-Release
- Fasta Syntax HOT 1
- bioSyntax Theme HOT 3
- Hackseq Day 2 Goals HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biosyntax-archive.