Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add STAR language and .star file extension for Starlark #4840

Merged
merged 14 commits into from
May 26, 2022
5 changes: 5 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ disambiguations:
pattern: '\$\w+[($]|(.)!\s*.+?\s*!\1|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}'
- language: Smalltalk
pattern: '\A\s*[\[{(^"''\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\['
- extensions: ['.star']
rules:
- language: STAR
pattern: '^loop_\s*$'
- language: Starlark
- extensions: ['.t']
rules:
- language: Perl
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5744,6 +5744,13 @@ SSH Config:
ace_mode: text
tm_scope: source.ssh-config
language_id: 554920715
STAR:
type: data
extensions:
- ".star"
tm_scope: none
ace_mode: text
language_id: 424510560
STON:
type: data
group: Smalltalk
Expand Down Expand Up @@ -6138,6 +6145,7 @@ Starlark:
color: "#76d275"
extensions:
- ".bzl"
- ".star"
filenames:
- BUCK
- BUILD
Expand Down
100 changes: 100 additions & 0 deletions samples/STAR/schedule.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@

# version 30001

data_schedule_general

_rlnScheduleName Schedules/mvf_basic/
_rlnScheduleCurrentNodeName UpdateMovies


# version 30001

data_schedule_floats

loop_
_rlnScheduleFloatVariableName #1
_rlnScheduleFloatVariableValue #2
_rlnScheduleFloatVariableResetValue #3
mut_movies_count 0.000000 0.000000
mut_movies_count_shadow 0.000000 0.000000
set_angpix 0.531500 0.531500
set_ctf_amp_contrast 0.100000 0.100000
set_ctf_powerspectrum_window 4.500000 4.500000
set_frame_dose 1.250000 1.250000
set_voltage 300.000000 300.000000


# version 30001

data_schedule_bools

loop_
_rlnScheduleBooleanVariableName #1
_rlnScheduleBooleanVariableValue #2
_rlnScheduleBooleanVariableResetValue #3
mut_have_more_movies 0 0


# version 30001

data_schedule_strings

loop_
_rlnScheduleStringVariableName #1
_rlnScheduleStringVariableValue #2
_rlnScheduleStringVariableResetValue #3
let_movies_starfile Schedules/mvf_basic/UpdateMovies/movies.star Schedules/mvf_basic/UpdateMovies/movies.star
let_movies_tablename movies movies
set_gain_file_path Micrographs/gain.mrc Micrographs/gain.mrc
set_movie_import_glob Micrographs/*.tif Micrographs/*.tif
set_mtf_file_path Micrographs/mtf_k3_300kv.star Micrographs/mtf_k3_300kv.star


# version 30001

data_schedule_operators

loop_
_rlnScheduleOperatorName #1
_rlnScheduleOperatorType #2
_rlnScheduleOperatorOutput #3
_rlnScheduleOperatorInput1 #4
_rlnScheduleOperatorInput2 #5
mut_have_more_movies=mut_movies_count_GT_mut_movies_count_shadow bool=gt mut_have_more_movies mut_movies_count mut_movies_count_shadow
mut_movies_count=COUNT_IMGS_let_movies_starfile_let_movies_tablename float=count_images mut_movies_count let_movies_starfile let_movies_tablename
mut_movies_count_shadow=SET_mut_movies_count float=set mut_movies_count_shadow mut_movies_count mut_movies_count_shadow


# version 30001

data_schedule_jobs

loop_
_rlnScheduleJobNameOriginal #1
_rlnScheduleJobName #2
_rlnScheduleJobMode #3
_rlnScheduleJobHasStarted #4
OutputProgress OutputProgress continue 0
StreamCTF StreamCTF continue 0
StreamMotion StreamMotion continue 0
UpdateMovies UpdateMovies continue 0


# version 30001

data_schedule_edges

loop_
_rlnScheduleEdgeInputNodeName #1
_rlnScheduleEdgeOutputNodeName #2
_rlnScheduleEdgeIsFork #3
_rlnScheduleEdgeOutputNodeNameIfTrue #4
_rlnScheduleEdgeBooleanVariable #5
UpdateMovies mut_movies_count=COUNT_IMGS_let_movies_starfile_let_movies_tablename 0 undefined undefined
mut_movies_count=COUNT_IMGS_let_movies_starfile_let_movies_tablename mut_have_more_movies=mut_movies_count_GT_mut_movies_count_shadow 0 undefined undefined
mut_have_more_movies=mut_movies_count_GT_mut_movies_count_shadow UpdateMovies 1 StreamMotion mut_have_more_movies
StreamMotion StreamCTF 0 undefined undefined
StreamCTF OutputProgress 0 undefined undefined
OutputProgress mut_movies_count_shadow=SET_mut_movies_count 0 undefined undefined
mut_movies_count_shadow=SET_mut_movies_count UpdateMovies 0 undefined undefined

62 changes: 62 additions & 0 deletions samples/STAR/schedule_pipeline.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

# version 30001

data_pipeline_general

_rlnPipeLineJobCounter 6


# version 30001

data_pipeline_processes

loop_
_rlnPipeLineProcessName #1
_rlnPipeLineProcessAlias #2
_rlnPipeLineProcessType #3
_rlnPipeLineProcessStatus #4
Schedules/mvf_basic/UpdateMovies/ None 0 1
Schedules/mvf_basic/StreamMotion/ None 1 1
Schedules/mvf_basic/StreamCTF/ None 2 1
Schedules/mvf_basic/OutputProgress/ None 99 1


# version 30001

data_pipeline_nodes

loop_
_rlnPipeLineNodeName #1
_rlnPipeLineNodeType #2
Schedules/mvf_basic/UpdateMovies/movies.star 0
Schedules/mvf_basic/StreamMotion/corrected_micrographs.star 1
Schedules/mvf_basic/StreamMotion/logfile.pdf 13
Schedules/mvf_basic/StreamCTF/micrographs_ctf.star 1
Schedules/mvf_basic/StreamCTF/logfile.pdf 13


# version 30001

data_pipeline_input_edges

loop_
_rlnPipeLineEdgeFromNode #1
_rlnPipeLineEdgeProcess #2
Schedules/mvf_basic/UpdateMovies/movies.star Schedules/mvf_basic/StreamMotion/
Schedules/mvf_basic/StreamMotion/corrected_micrographs.star Schedules/mvf_basic/StreamCTF/
Schedules/mvf_basic/StreamCTF/micrographs_ctf.star Schedules/mvf_basic/OutputProgress/


# version 30001

data_pipeline_output_edges

loop_
_rlnPipeLineEdgeProcess #1
_rlnPipeLineEdgeToNode #2
Schedules/mvf_basic/UpdateMovies/ Schedules/mvf_basic/UpdateMovies/movies.star
Schedules/mvf_basic/StreamMotion/ Schedules/mvf_basic/StreamMotion/corrected_micrographs.star
Schedules/mvf_basic/StreamMotion/ Schedules/mvf_basic/StreamMotion/logfile.pdf
Schedules/mvf_basic/StreamCTF/ Schedules/mvf_basic/StreamCTF/micrographs_ctf.star
Schedules/mvf_basic/StreamCTF/ Schedules/mvf_basic/StreamCTF/logfile.pdf

80 changes: 80 additions & 0 deletions samples/STAR/symop.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# symop.star: Converted from symop.lib on Sun Aug 27 08:39:43 2000

# Each set of symmetry operators is written in its own data block
# The data block tag is the space group number
# The original spacegroup definition line is given as a comment




############################# 1 #############################

data_1

# 1 1 1 P1 PG1 TRICLINIC 'P 1'

_symmetry.Int_Tables_number 1
_symmetry.space_group_name_H-M P1
_symmetry.cell_setting TRICLINIC

loop_
_symmetry_equiv.id
_symmetry_equiv.pos_as_xyz
1 X,Y,Z


############################# 2 #############################

data_2

# 2 2 2 P-1 PG1bar TRICLINIC 'P -1'

_symmetry.Int_Tables_number 2
_symmetry.space_group_name_H-M P-1
_symmetry.cell_setting TRICLINIC

loop_
_symmetry_equiv.id
_symmetry_equiv.pos_as_xyz
1 X,Y,Z
2 -X,-Y,-Z



############################# 5090row #############################

data_5090row

loop_
_symmetry_equiv.id
_symmetry_equiv.pos_as_xyz
1 X,Y,Z
2 -X,-Y,Z
3 -Y,X,Z
############################# 5090col #############################

data_5090col

# 5090 8 8 P4212 PG422 TETRAGONAL_4axis 'P 4 21 2'

_symmetry.Int_Tables_number 5090
_symmetry.space_group_name_H-M P4212
_symmetry.cell_setting TETRAGONAL_4axis

############################# 5090both #############################

data_5090both

# 5090 8 8 P4212 PG422 TETRAGONAL_4axis 'P 4 21 2'

_symmetry.Int_Tables_number 5090
_symmetry.space_group_name_H-M P4212
_symmetry.cell_setting TETRAGONAL_4axis

loop_
_symmetry_equiv.id
_symmetry_equiv.pos_as_xyz
1 X,Y,Z
2 -X,-Y,Z
3 -Y,X,Z
4 Y,-X,Z
Loading